OSDN Git Service

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

index 448d939..20cf8cf 100644 (file)
@@ -1141,12 +1141,12 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
                if (i == 0) {
                        twl->client = client;
                } else {
-                       twl->client = i2c_new_dummy(client->adapter,
+                       twl->client = i2c_new_dummy_device(client->adapter,
                                                    client->addr + i);
-                       if (!twl->client) {
+                       if (IS_ERR(twl->client)) {
                                dev_err(&client->dev,
                                        "can't attach client %d\n", i);
-                               status = -ENOMEM;
+                               status = PTR_ERR(twl->client);
                                goto fail;
                        }
                }