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

mfd: max8907: 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
b8afcd54 0005a9e1

+3 -3
+3 -3
drivers/mfd/max8907.c
··· 214 214 goto err_regmap_gen; 215 215 } 216 216 217 - max8907->i2c_rtc = i2c_new_dummy(i2c->adapter, MAX8907_RTC_I2C_ADDR); 218 - if (!max8907->i2c_rtc) { 219 - ret = -ENOMEM; 217 + max8907->i2c_rtc = i2c_new_dummy_device(i2c->adapter, MAX8907_RTC_I2C_ADDR); 218 + if (IS_ERR(max8907->i2c_rtc)) { 219 + ret = PTR_ERR(max8907->i2c_rtc); 220 220 goto err_dummy_rtc; 221 221 } 222 222 i2c_set_clientdata(max8907->i2c_rtc, max8907);