lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKsAMRkmGX160gHl@pc>
Date: Sun, 24 Aug 2025 13:06:09 +0100
From: Salah Triki <salah.triki@...il.com>
To: Jonathan Cameron <jic23@...nel.org>,
	David Lechner <dlechner@...libre.com>,
	Nuno Sá <nuno.sa@...log.com>,
	Andy Shevchenko <andy@...nel.org>, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org
Cc: salah.triki@...il.com
Subject: [PATCH v5 3/3] iio: pressure: bmp280: Use gpiod_set_value_cansleep()

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@...il.com>
Reviewed-by: David Lechner <dlechner@...libre.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
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;
 
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ