mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: cdcp206@gmail.com, "Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Olof Johansson" <olof@lixom.net>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: accel: bmc150: check reset write error
Date: Wed, 23 Sep 2026 10:34:55 -0700	[thread overview]
Message-ID: <319e10c431f821e672a378943784b6c650b13fab.camel@linux.intel.com> (raw)
In-Reply-To: <20260923-iio-bmc150-check-reset-error-v1-1-b8c1ebc4c947@gmail.com>

On Wed, 2026-09-23 at 11:41 -0500, Carlos Casadiego via B4 Relay wrote:
> From: Carlos Casadiego <cdcp206@gmail.com>
> 
> The software reset is required to bring the device into a known
> state before reading the chip ID.
> 
> Check the return value of regmap_write() and abort initialization if
> the reset command cannot be written.
> 
> Fixes: 1c500840934a ("iio: accel: bmc150: reset chip at init time")
> 
> Signed-off-by: Carlos Casadiego <cdcp206@gmail.com>

Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

> ---
>  drivers/iio/accel/bmc150-accel-core.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/accel/bmc150-accel-core.c
> b/drivers/iio/accel/bmc150-accel-core.c
> index 46bb36d9366e..43a39e1ccce5 100644
> --- a/drivers/iio/accel/bmc150-accel-core.c
> +++ b/drivers/iio/accel/bmc150-accel-core.c
> @@ -1561,8 +1561,12 @@ static int bmc150_accel_chip_init(struct
> bmc150_accel_data *data)
>  	 * Reset chip to get it in a known good state. A delay of
> 1.8ms after
>  	 * reset is required according to the data sheets of
> supported chips.
>  	 */
> -	regmap_write(data->regmap, BMC150_ACCEL_REG_RESET,
> -		     BMC150_ACCEL_RESET_VAL);
> +	ret = regmap_write(data->regmap, BMC150_ACCEL_REG_RESET,
> +			   BMC150_ACCEL_RESET_VAL);
> +	if (ret < 0) {
> +		dev_err(dev, "Error writing reset register\n");
> +		return ret;
> +	}
>  	usleep_range(1800, 2500);
>  
>  	ret = regmap_read(data->regmap, BMC150_ACCEL_REG_CHIP_ID,
> &val);
> 
> ---
> base-commit: d8c0f48f0b1583308a98401c0c7b1a65d1d43a6c
> change-id: 20260923-iio-bmc150-check-reset-error-389b096b0ad4
> 
> Best regards,
> --  
> Carlos Casadiego <cdcp206@gmail.com>
> 

      reply	other threads:[~2026-09-23 17:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-23 16:41 Carlos Casadiego via B4 Relay
2026-09-23 17:34 ` srinivas pandruvada [this message]

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=319e10c431f821e672a378943784b6c650b13fab.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=cdcp206@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=olof@lixom.net \
    /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

all inboxes | Powered by JetHome®