Skip to contentSkip to conversation

iio: adc: ti-ads124s08: Switch to fsleep()

PATCH In review Fabio Estevam 2 participants 4 messages Dec 9, 2024 – Jan 18, 2025 IIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: adc: ti-ads124s08: Switch to fsleep()

From: Fabio Estevam <[email protected]>

According to Documentation/timers/delay_sleep_functions.rst, fsleep() is the preferred delay function to be used in non-atomic context, so switch to it accordingly.

---
Changes since v1:
- Use [email protected] in the Suggested-by tag.
- Add Reviewed-by.

 drivers/iio/adc/ti-ads124s08.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads124s08.c +1 -1
index f452f57f11c9..77c299bb4ebc 100644
@@ -184,7 +184,7 @@ static int ads124s_reset(struct iio_dev *indio_dev)
 
 	if (priv->reset_gpio) {
 		gpiod_set_value_cansleep(priv->reset_gpio, 0);
-		udelay(200);
+		fsleep(200);
 		gpiod_set_value_cansleep(priv->reset_gpio, 1);
 	} else {
 		return ads124s_write_cmd(indio_dev, ADS124S08_CMD_RESET);
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 9 lines · On Mon, 9 Dec 2024 15:16:24 -0300 Fabio Estevam <[email protected]> wrote:

From: Fabio Estevam <[email protected]>

According to Documentation/timers/delay_sleep_functions.rst, fsleep() is the preferred delay function to be used in non-atomic context, so switch to it accordingly.

This is one is stalled behind the cansleep patch which I decided was trivial enough and sort of a fix so sent the fast way.

If the two had been together I'd have included this as well, but now it's just an optimization so needs to go the slow route.

Jonathan

Quoted 21 lines

---
Changes since v1:
- Use [email protected] in the Suggested-by tag.
- Add Reviewed-by.

 drivers/iio/adc/ti-ads124s08.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ti-ads124s08.c +1 -1
index f452f57f11c9..77c299bb4ebc 100644
@@ -184,7 +184,7 @@ static int ads124s_reset(struct iio_dev *indio_dev)
 
 	if (priv->reset_gpio) {
 		gpiod_set_value_cansleep(priv->reset_gpio, 0);
-		udelay(200);
+		fsleep(200);
 		gpiod_set_value_cansleep(priv->reset_gpio, 1);
 	} else {
 		return ads124s_write_cmd(indio_dev, ADS124S08_CMD_RESET);
#2 lore raw

Hi Jonathan,

Quoted 2 lines · Jonathan Cameron

If the two had been together I'd have included this as well, but now it's just an optimization so needs to go the slow route.

That's OK. This one is just an improvement and can wait.

Thanks

maintainer
#3 lore raw
Quoted 11 lines · On Sun, 15 Dec 2024 09:32:47 -0300 Fabio Estevam <[email protected]> wrote:

Hi Jonathan,

Quoted 2 lines · Jonathan Cameron

If the two had been together I'd have included this as well, but now it's just an optimization so needs to go the slow route.

That's OK. This one is just an improvement and can wait.

Thanks

Now applied to the testing branch of iio.git

Thanks,