Commit b5fbf056 authored by Wolfram Sang's avatar Wolfram Sang Committed by Jonathan Cameron

iio: imu: inv_mpu6050: convert to use i2c_new_client_device()

Move away from the deprecated API and return the shiny new ERRPTR where
useful.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarJean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 9623473c
...@@ -135,6 +135,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) ...@@ -135,6 +135,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client)
st->mux_client = NULL; st->mux_client = NULL;
if (ACPI_HANDLE(&client->dev)) { if (ACPI_HANDLE(&client->dev)) {
struct i2c_board_info info; struct i2c_board_info info;
struct i2c_client *mux_client;
struct acpi_device *adev; struct acpi_device *adev;
int ret = -1; int ret = -1;
...@@ -172,9 +173,10 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) ...@@ -172,9 +173,10 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client)
} else } else
return 0; /* no secondary addr, which is OK */ return 0; /* no secondary addr, which is OK */
} }
st->mux_client = i2c_new_device(st->muxc->adapter[0], &info); mux_client = i2c_new_client_device(st->muxc->adapter[0], &info);
if (!st->mux_client) if (IS_ERR(mux_client))
return -ENODEV; return PTR_ERR(mux_client);
st->mux_client = mux_client;
} }
return 0; return 0;
......
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