iio: pressure: hp03: convert to i2c_new_dummy_device
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 22 Jul 2019 17:26:13 +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/pressure/hp03.c

index f001025..026ba15 100644 (file)
@@ -243,10 +243,10 @@ static int hp03_probe(struct i2c_client *client,
         * which has it's dedicated I2C address and contains
         * the calibration constants for the sensor.
         */
-       priv->eeprom_client = i2c_new_dummy(client->adapter, HP03_EEPROM_ADDR);
-       if (!priv->eeprom_client) {
+       priv->eeprom_client = i2c_new_dummy_device(client->adapter, HP03_EEPROM_ADDR);
+       if (IS_ERR(priv->eeprom_client)) {
                dev_err(dev, "New EEPROM I2C device failed\n");
-               return -ENODEV;
+               return PTR_ERR(priv->eeprom_client);
        }
 
        priv->eeprom_regmap = regmap_init_i2c(priv->eeprom_client,