]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
rtc: isl12026: convert to i2c_new_dummy_device
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 22 Jul 2019 17:26:15 +0000 (19:26 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 22 Jul 2019 20:30:19 +0000 (22:30 +0200)
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>
Link: https://lore.kernel.org/r/20190722172618.4061-2-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-isl12026.c

index 97f594f9667cdd5066e393bebfa82e55b325aec4..5b6b17fb6d6281466488936e246d1d58cff19105 100644 (file)
@@ -454,9 +454,9 @@ static int isl12026_probe_new(struct i2c_client *client)
 
        isl12026_force_power_modes(client);
 
-       priv->nvm_client = i2c_new_dummy(client->adapter, ISL12026_EEPROM_ADDR);
-       if (!priv->nvm_client)
-               return -ENOMEM;
+       priv->nvm_client = i2c_new_dummy_device(client->adapter, ISL12026_EEPROM_ADDR);
+       if (IS_ERR(priv->nvm_client))
+               return PTR_ERR(priv->nvm_client);
 
        priv->rtc = devm_rtc_allocate_device(&client->dev);
        ret = PTR_ERR_OR_ZERO(priv->rtc);