linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: fbtft: fb_agm1264k-fl.c: Replaced udelay by usleep_range
@ 2020-07-24 10:09 Fabrizio Benedetti
  2020-07-24 13:24 ` Greg KH
  2020-07-26  8:06 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrizio Benedetti @ 2020-07-24 10:09 UTC (permalink / raw)
  To: gregkh; +Cc: linux-iio

This patch replace udelay with usleep_range
according to the Documentation/timers/timers-howto.txt .
The usleep_range have a range that is >= of udelay.

Signed-off-by: Fabrizio Benedetti <fabrizio.benedetti.82@gmail.com>
---
 drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
index eeeeec97ad27..4a67a660bb17 100644
--- a/drivers/staging/fbtft/fb_agm1264k-fl.c
+++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
@@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par)
 	dev_dbg(par->info->device, "%s()\n", __func__);
 
 	gpiod_set_value(par->gpio.reset, 0);
-	udelay(20);
+	usleep_range(20, 25);
 	gpiod_set_value(par->gpio.reset, 1);
 	mdelay(120);
 }
-- 
2.17.1


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

* Re: [PATCH] staging: fbtft: fb_agm1264k-fl.c: Replaced udelay by usleep_range
  2020-07-24 10:09 [PATCH] staging: fbtft: fb_agm1264k-fl.c: Replaced udelay by usleep_range Fabrizio Benedetti
@ 2020-07-24 13:24 ` Greg KH
  2020-07-26  8:06 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2020-07-24 13:24 UTC (permalink / raw)
  To: Fabrizio Benedetti; +Cc: linux-iio

On Fri, Jul 24, 2020 at 12:09:07PM +0200, Fabrizio Benedetti wrote:
> This patch replace udelay with usleep_range
> according to the Documentation/timers/timers-howto.txt .
> The usleep_range have a range that is >= of udelay.
> 
> Signed-off-by: Fabrizio Benedetti <fabrizio.benedetti.82@gmail.com>
> ---
>  drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c
> index eeeeec97ad27..4a67a660bb17 100644
> --- a/drivers/staging/fbtft/fb_agm1264k-fl.c
> +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c
> @@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par)
>  	dev_dbg(par->info->device, "%s()\n", __func__);
>  
>  	gpiod_set_value(par->gpio.reset, 0);
> -	udelay(20);
> +	usleep_range(20, 25);

And are you sure that 25 is ok here?

Unless you have the hardware, don't make up random numbers for things
like delays :)

Also, be sure you use the correct mailing lists, why did you ignore the
output of scripts/get_maintainer.pl for this patch?

thanks,

greg k-h

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

* Re: [PATCH] staging: fbtft: fb_agm1264k-fl.c: Replaced udelay by usleep_range
  2020-07-24 10:09 [PATCH] staging: fbtft: fb_agm1264k-fl.c: Replaced udelay by usleep_range Fabrizio Benedetti
  2020-07-24 13:24 ` Greg KH
@ 2020-07-26  8:06 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2020-07-26  8:06 UTC (permalink / raw)
  To: Fabrizio Benedetti; +Cc: Greg Kroah-Hartman, linux-iio

On Fri, Jul 24, 2020 at 1:10 PM Fabrizio Benedetti
<fabrizio.benedetti.82@gmail.com> wrote:
>
> This patch replace udelay with usleep_range
> according to the Documentation/timers/timers-howto.txt .
> The usleep_range have a range that is >= of udelay.

has

Also all functions we refer to as func(). Note parentheses.

...

> @@ -85,7 +85,7 @@ static void reset(struct fbtft_par *par)
>         dev_dbg(par->info->device, "%s()\n", __func__);
>
>         gpiod_set_value(par->gpio.reset, 0);
> -       udelay(20);
> +       usleep_range(20, 25);
>         gpiod_set_value(par->gpio.reset, 1);
>         mdelay(120);
>  }

It's funny you left mdelay and on top of this all of the above makes
sense if you also switch to gpiod_set_value_can_sleep().

This will also require your analysis of the context (atomic /
non-atomic) in the commit message.

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2020-07-26  8:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 10:09 [PATCH] staging: fbtft: fb_agm1264k-fl.c: Replaced udelay by usleep_range Fabrizio Benedetti
2020-07-24 13:24 ` Greg KH
2020-07-26  8:06 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).