Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Salah Triki <salah.triki@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/3] iio: pressure: bmp280: Use gpiod_set_value_cansleep()
Date: Sat, 13 Sep 2025 15:25:52 +0100	[thread overview]
Message-ID: <20250913152552.5f7d82d3@jic23-huawei> (raw)
In-Reply-To: <aKsAMRkmGX160gHl@pc>

On Sun, 24 Aug 2025 13:06:09 +0100
Salah Triki <salah.triki@gmail.com> wrote:

> Replace `gpiod_set_value()` with `gpiod_set_value_cansleep()`, which is
> required when the GPIO controller is connected via a slow bus such as
> I2C. This is also safe to use in sleepable contexts like the driver
> probe function.
> 
> Signed-off-by: Salah Triki <salah.triki@gmail.com>
> Reviewed-by: David Lechner <dlechner@baylibre.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
dropped my editted v3 and picked this up.

Please don't send parts of patch series and if a patch has already
being replied, it is fine for the numbering in a later version to update
to reflect that.  Anyhow not a problem this time as I think I have
all the right patches.

Jonathan

> ---
> Changes in v5:
>   - Clarify commit message in patch 3/3 to better explain why
>     gpiod_set_value_cansleep() is needed, as suggested by Andy
>     Shevchenko.
> 
> Changes in v4:
>   - Split patch 2/2 into two separate patches, as suggested by Markus
>     Elfring.
> 
> Changes in v3:
>   - Split into two separate patches, as suggested by Andy Shevchenko.
>   - Improve the error message to "failed to get reset GPIO", as
>     suggested by David Lechner.
>   - Add Fixes and Cc tags where appropriate, as suggested by Markus
>     Elfring.
> 
> Changes in v2:
>   - Use IS_ERR() instead of IS_ERR_OR_NULL()
>   - Drop dev_info()
>   - Use gpiod_set_value_cansleep()
>   - Improve commit title and message
>  drivers/iio/pressure/bmp280-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/pressure/bmp280-core.c b/drivers/iio/pressure/bmp280-core.c
> index 1f0852fc3414..656f6189c84c 100644
> --- a/drivers/iio/pressure/bmp280-core.c
> +++ b/drivers/iio/pressure/bmp280-core.c
> @@ -3217,7 +3217,7 @@ int bmp280_common_probe(struct device *dev,
>  		return dev_err_probe(dev, PTR_ERR(gpiod), "failed to get reset GPIO\n");
>  
>  	/* Deassert the signal */
> -	gpiod_set_value(gpiod, 0);
> +	gpiod_set_value_cansleep(gpiod, 0);
>  
>  	data->regmap = regmap;
>  


      parent reply	other threads:[~2025-09-13 14:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-24 12:06 [PATCH v5 3/3] iio: pressure: bmp280: Use gpiod_set_value_cansleep() Salah Triki
2025-08-25 14:52 ` Jonathan Cameron
2025-09-13 14:25 ` Jonathan Cameron [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=20250913152552.5f7d82d3@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=salah.triki@gmail.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