Linux IIO development
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: haibo.chen@nxp.com, jic23@kernel.org, lars@metafoo.de
Cc: linux-iio@vger.kernel.org, linux-imx@nxp.com
Subject: Re: [PATCH v2] iio: accel: mma8452: ignore the return value of reset operation
Date: Wed, 15 Jun 2022 18:10:47 +0200	[thread overview]
Message-ID: <8690f687-8f9d-b03f-226f-3a289e718ed5@redhat.com> (raw)
In-Reply-To: <1655292718-14287-1-git-send-email-haibo.chen@nxp.com>

Hi,

On 6/15/22 13:31, haibo.chen@nxp.com wrote:
> From: Haibo Chen <haibo.chen@nxp.com>
> 
> 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@nxp.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

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);


  reply	other threads:[~2022-06-15 16:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 11:31 [PATCH v2] iio: accel: mma8452: ignore the return value of reset operation haibo.chen
2022-06-15 16:10 ` Hans de Goede [this message]
2022-06-15 21:15   ` Jonathan Cameron
2022-06-16  1:34     ` Bough Chen
2022-06-18 16:30       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8690f687-8f9d-b03f-226f-3a289e718ed5@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=haibo.chen@nxp.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox