Commit 8f9508eb authored by Wolfram Sang's avatar Wolfram Sang Committed by Guenter Roeck

hwmon: (asb100) 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-2-wsa+renesas@sang-engineering.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 12163cfb
......@@ -706,21 +706,21 @@ static int asb100_detect_subclients(struct i2c_client *client)
goto ERROR_SC_2;
}
data->lm75[0] = i2c_new_dummy(adapter, sc_addr[0]);
if (!data->lm75[0]) {
data->lm75[0] = i2c_new_dummy_device(adapter, sc_addr[0]);
if (IS_ERR(data->lm75[0])) {
dev_err(&client->dev,
"subclient %d registration at address 0x%x failed.\n",
1, sc_addr[0]);
err = -ENOMEM;
err = PTR_ERR(data->lm75[0]);
goto ERROR_SC_2;
}
data->lm75[1] = i2c_new_dummy(adapter, sc_addr[1]);
if (!data->lm75[1]) {
data->lm75[1] = i2c_new_dummy_device(adapter, sc_addr[1]);
if (IS_ERR(data->lm75[1])) {
dev_err(&client->dev,
"subclient %d registration at address 0x%x failed.\n",
2, sc_addr[1]);
err = -ENOMEM;
err = PTR_ERR(data->lm75[1]);
goto ERROR_SC_3;
}
......
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