Re: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device()
From: Jonathan Cameron
Date: Sat Mar 28 2020 - 11:13:24 EST
On Fri, 27 Mar 2020 10:52:02 +0000
Jean-Baptiste Maneyrol <JManeyrol@xxxxxxxxxxxxxx> wrote:
> Hello,
>
> thanks for the patch.
> Looks good for me.
>
> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@xxxxxxxxxxxxxx>
Applied to the togreg branch of iio.git and pushed out as testing.
Note this has missed the coming merge window. Hope that doesn't matter for your
deprecation plans.
Thanks,
Jonathan
>
> Best regards,
> JB
>
>
> From: linux-iio-owner@xxxxxxxxxxxxxxx <linux-iio-owner@xxxxxxxxxxxxxxx> on behalf of Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
>
> Sent: Thursday, March 26, 2020 22:09
>
> To: linux-i2c@xxxxxxxxxxxxxxx <linux-i2c@xxxxxxxxxxxxxxx>
>
> Cc: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>; Jonathan Cameron <jic23@xxxxxxxxxx>; Hartmut Knaack <knaack.h@xxxxxx>; Lars-Peter Clausen <lars@xxxxxxxxxx>; Peter Meerwald-Stadler <pmeerw@xxxxxxxxxx>; linux-iio@xxxxxxxxxxxxxxx <linux-iio@xxxxxxxxxxxxxxx>;
> linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>
>
> Subject: [PATCH 1/1] iio: imu: inv_mpu6050: convert to use i2c_new_client_device()
>
> Â
>
>
> ÂCAUTION: This email originated from outside of the organization. Please make sure the sender is who they say they are and do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
>
> Move away from the deprecated API and return the shiny new ERRPTR where
>
> useful.
>
>
>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
>
> ---
>
> Âdrivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c | 8 +++++---
>
> Â1 file changed, 5 insertions(+), 3 deletions(-)
>
>
>
> diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
>
> index 2f8560ba4572..c27d06035c8b 100644
>
> --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
>
> +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
>
> @@ -135,6 +135,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client)
>
> ÂÂÂÂÂÂÂÂ st->mux_client = NULL;
>
> ÂÂÂÂÂÂÂÂ if (ACPI_HANDLE(&client->dev)) {
>
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ struct i2c_board_info info;
>
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ struct i2c_client *mux_client;
>
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ struct acpi_device *adev;
>
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ int ret = -1;
>
> Â
>
> @@ -172,9 +173,10 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client)
>
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ } else
>
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ return 0; /* no secondary addr, which is OK */
>
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ }
>
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ st->mux_client = i2c_new_device(st->muxc->adapter[0], &info);
>
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (!st->mux_client)
>
> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ return -ENODEV;
>
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ mux_client = i2c_new_client_device(st->muxc->adapter[0], &info);
>
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (IS_ERR(mux_client))
>
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ return PTR_ERR(mux_client);
>
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ st->mux_client = mux_client;
>
> ÂÂÂÂÂÂÂÂ }
>
> Â
>
> ÂÂÂÂÂÂÂÂ return 0;
>