Commit 22e96ce3 authored by Wolfram Sang's avatar Wolfram Sang Committed by Guenter Roeck

hwmon: (w83781d) convert to i2c_new_dummy_device

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20190722172611.3797-4-wsa+renesas@sang-engineering.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 25d40164
...@@ -894,12 +894,12 @@ w83781d_detect_subclients(struct i2c_client *new_client) ...@@ -894,12 +894,12 @@ w83781d_detect_subclients(struct i2c_client *new_client)
} }
for (i = 0; i < num_sc; i++) { for (i = 0; i < num_sc; i++) {
data->lm75[i] = i2c_new_dummy(adapter, sc_addr[i]); data->lm75[i] = i2c_new_dummy_device(adapter, sc_addr[i]);
if (!data->lm75[i]) { if (IS_ERR(data->lm75[i])) {
dev_err(&new_client->dev, dev_err(&new_client->dev,
"Subclient %d registration at address 0x%x failed.\n", "Subclient %d registration at address 0x%x failed.\n",
i, sc_addr[i]); i, sc_addr[i]);
err = -ENOMEM; err = PTR_ERR(data->lm75[i]);
if (i == 1) if (i == 1)
goto ERROR_SC_3; goto ERROR_SC_3;
goto ERROR_SC_2; goto ERROR_SC_2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment