Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: max77843: Convert to i2c_new_dummy_device

Move from i2c_new_dummy() to i2c_new_dummy_device(), so we now get an
ERRPTR which we use in error handling.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Wolfram Sang and committed by
Lee Jones
0005a9e1 ad28edcb

+3 -3
+3 -3
drivers/mfd/max77843.c
··· 70 70 { 71 71 int ret; 72 72 73 - max77843->i2c_chg = i2c_new_dummy(max77843->i2c->adapter, I2C_ADDR_CHG); 74 - if (!max77843->i2c_chg) { 73 + max77843->i2c_chg = i2c_new_dummy_device(max77843->i2c->adapter, I2C_ADDR_CHG); 74 + if (IS_ERR(max77843->i2c_chg)) { 75 75 dev_err(&max77843->i2c->dev, 76 76 "Cannot allocate I2C device for Charger\n"); 77 - return -ENODEV; 77 + return PTR_ERR(max77843->i2c_chg); 78 78 } 79 79 i2c_set_clientdata(max77843->i2c_chg, max77843); 80 80