iio: light: veml6070: convert to i2c_new_dummy_device
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 22 Jul 2019 17:26:12 +0000 (19:26 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 27 Jul 2019 21:52:07 +0000 (22:52 +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: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/veml6070.c

index a3138e1b58034d883efbc7a0dab566b7e62b8b4c..0be553ad598945cacf1a3acb51aa94312ef47946 100644 (file)
@@ -158,10 +158,10 @@ static int veml6070_probe(struct i2c_client *client,
        indio_dev->name = VEML6070_DRV_NAME;
        indio_dev->modes = INDIO_DIRECT_MODE;
 
-       data->client2 = i2c_new_dummy(client->adapter, VEML6070_ADDR_DATA_LSB);
-       if (!data->client2) {
+       data->client2 = i2c_new_dummy_device(client->adapter, VEML6070_ADDR_DATA_LSB);
+       if (IS_ERR(data->client2)) {
                dev_err(&client->dev, "i2c device for second chip address failed\n");
-               return -ENODEV;
+               return PTR_ERR(data->client2);
        }
 
        data->config = VEML6070_IT_10 | VEML6070_COMMAND_RSRVD |