Re: [PATCH v2] iio: accel: mma8452: ignore the return value of reset operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 6/15/22 13:31, haibo.chen@xxxxxxx wrote:
> From: Haibo Chen <haibo.chen@xxxxxxx>
> 
> On fxls8471, after set the reset bit, the device will reset immediately,
> will not give ACK. So ignore the return value of this reset operation,
> let the following code logic to check whether the reset operation works.
> 
> Signed-off-by: Haibo Chen <haibo.chen@xxxxxxx>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@xxxxxxxxxx>

Regards,

Hans



> ---
>  drivers/iio/accel/mma8452.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index e0f0c0abed28..c7d9ca96dbaa 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1511,10 +1511,14 @@ static int mma8452_reset(struct i2c_client *client)
>  	int i;
>  	int ret;
>  
> -	ret = i2c_smbus_write_byte_data(client,	MMA8452_CTRL_REG2,
> +	/*
> +	 * Find on fxls8471, after config reset bit, it reset immediately,
> +	 * and will not give ACK, so here do not check the return value.
> +	 * The following code will read the reset register, and check whether
> +	 * this reset works.
> +	 */
> +	i2c_smbus_write_byte_data(client, MMA8452_CTRL_REG2,
>  					MMA8452_CTRL_REG2_RST);
> -	if (ret < 0)
> -		return ret;
>  
>  	for (i = 0; i < 10; i++) {
>  		usleep_range(100, 200);




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux