OSDN Git Service

mfd: 88pm860x-core: Convert to i2c_new_dummy_device
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 22 Jul 2019 17:26:09 +0000 (19:26 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 12 Aug 2019 07:51:50 +0000 (08:51 +0100)
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>
drivers/mfd/88pm860x-core.c

index 9e0bd13..c9bae71 100644 (file)
@@ -1178,12 +1178,12 @@ static int pm860x_probe(struct i2c_client *client)
         */
        if (pdata->companion_addr && (pdata->companion_addr != client->addr)) {
                chip->companion_addr = pdata->companion_addr;
-               chip->companion = i2c_new_dummy(chip->client->adapter,
+               chip->companion = i2c_new_dummy_device(chip->client->adapter,
                                                chip->companion_addr);
-               if (!chip->companion) {
+               if (IS_ERR(chip->companion)) {
                        dev_err(&client->dev,
                                "Failed to allocate I2C companion device\n");
-                       return -ENODEV;
+                       return PTR_ERR(chip->companion);
                }
                chip->regmap_companion = regmap_init_i2c(chip->companion,
                                                        &pm860x_regmap_config);