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

mfd: max8998: 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
7a99c8f3 4e32bff6

+3 -3
+3 -3
drivers/mfd/max8998.c
··· 195 195 } 196 196 mutex_init(&max8998->iolock); 197 197 198 - max8998->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR); 199 - if (!max8998->rtc) { 198 + max8998->rtc = i2c_new_dummy_device(i2c->adapter, RTC_I2C_ADDR); 199 + if (IS_ERR(max8998->rtc)) { 200 200 dev_err(&i2c->dev, "Failed to allocate I2C device for RTC\n"); 201 - return -ENODEV; 201 + return PTR_ERR(max8998->rtc); 202 202 } 203 203 i2c_set_clientdata(max8998->rtc, max8998); 204 204