mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
lp8727_charger: Add supported i2c functionality check routine
lp8727 i2c r/w functions are based on SMBUS I2C BLOCK. So the driver needs to check whether i2c bus supports this functionality or not. Signed-off-by: Woogyom Kim <[email protected]> Signed-off-by: Anton Vorontsov <[email protected]>
This commit is contained in:
parent
2165c8a45b
commit
998a8e7a72
1 changed files with 3 additions and 0 deletions
|
|
@ -425,6 +425,9 @@ static int lp8727_probe(struct i2c_client *cl, const struct i2c_device_id *id)
|
|||
struct lp8727_chg *pchg;
|
||||
int ret;
|
||||
|
||||
if (!i2c_check_functionality(cl->adapter, I2C_FUNC_SMBUS_I2C_BLOCK))
|
||||
return -EIO;
|
||||
|
||||
pchg = kzalloc(sizeof(*pchg), GFP_KERNEL);
|
||||
if (!pchg)
|
||||
return -ENOMEM;
|
||||
|
|
|
|||
Loading…
Reference in a new issue