mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
rtc-pcf8583: Check for i2c adapter functionality
Not all i2c adapters support I2C-level messaging. Check that the adapter does before probing for a PCF8583 chip, as the driver makes use of i2c_transfer and i2c_master_send. Signed-off-by: Jean Delvare <[email protected]> Signed-off-by: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a95e23a27b
commit
c018664c51
1 changed files with 3 additions and 0 deletions
|
|
@ -332,6 +332,9 @@ static int pcf8583_probe(struct i2c_adapter *adap, int addr, int kind)
|
|||
}
|
||||
};
|
||||
|
||||
if (!i2c_check_functionality(adap, I2C_FUNC_I2C))
|
||||
return 0;
|
||||
|
||||
pcf = kzalloc(sizeof(*pcf), GFP_KERNEL);
|
||||
if (!pcf)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue