mfd: twl-core: 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: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
Wolfram Sang 2019-07-22 19:26:21 +02:00 committed by Lee Jones
parent ad9fc1f422
commit ba972dac98

View 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;
}
}