Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v2] iio: adc: ti-ads124s08: Switch to fsleep()
@ 2024-12-09 18:16 Fabio Estevam
  2024-12-15 12:30 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2024-12-09 18:16 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, andriy.shevchenko, Fabio Estevam, Andy Shevchenko

From: Fabio Estevam <festevam@denx.de>

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.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v1:
- Use andriy.shevchenko@linux.intel.com in the Suggested-by tag.
- Add Reviewed-by.

 drivers/iio/adc/ti-ads124s08.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
index f452f57f11c9..77c299bb4ebc 100644
--- a/drivers/iio/adc/ti-ads124s08.c
+++ b/drivers/iio/adc/ti-ads124s08.c
@@ -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.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] iio: adc: ti-ads124s08: Switch to fsleep()
  2024-12-09 18:16 [PATCH v2] iio: adc: ti-ads124s08: Switch to fsleep() Fabio Estevam
@ 2024-12-15 12:30 ` Jonathan Cameron
  2024-12-15 12:32   ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2024-12-15 12:30 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-iio, andriy.shevchenko, Fabio Estevam, Andy Shevchenko

On Mon,  9 Dec 2024 15:16:24 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> From: Fabio Estevam <festevam@denx.de>
> 
> 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.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
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

> ---
> Changes since v1:
> - Use andriy.shevchenko@linux.intel.com in the Suggested-by tag.
> - Add Reviewed-by.
> 
>  drivers/iio/adc/ti-ads124s08.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c
> index f452f57f11c9..77c299bb4ebc 100644
> --- a/drivers/iio/adc/ti-ads124s08.c
> +++ b/drivers/iio/adc/ti-ads124s08.c
> @@ -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);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] iio: adc: ti-ads124s08: Switch to fsleep()
  2024-12-15 12:30 ` Jonathan Cameron
@ 2024-12-15 12:32   ` Fabio Estevam
  2025-01-18 17:15     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2024-12-15 12:32 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, andriy.shevchenko, Fabio Estevam, Andy Shevchenko

Hi Jonathan,

On Sun, Dec 15, 2024 at 9:30 AM Jonathan Cameron <jic23@kernel.org> wrote:

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] iio: adc: ti-ads124s08: Switch to fsleep()
  2024-12-15 12:32   ` Fabio Estevam
@ 2025-01-18 17:15     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2025-01-18 17:15 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-iio, andriy.shevchenko, Fabio Estevam, Andy Shevchenko

On Sun, 15 Dec 2024 09:32:47 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> Hi Jonathan,
> 
> On Sun, Dec 15, 2024 at 9:30 AM Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > 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,


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-18 17:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09 18:16 [PATCH v2] iio: adc: ti-ads124s08: Switch to fsleep() Fabio Estevam
2024-12-15 12:30 ` Jonathan Cameron
2024-12-15 12:32   ` Fabio Estevam
2025-01-18 17:15     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox