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: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
9623473cbb
commit
b5fbf0568c
@ -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)
|
|||||||
} 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user