Linux GPIO subsystem development
 help / color / mirror / Atom feed
* Re: [PATCH] rfkill-gpio: Use gpio cansleep version
       [not found] ` <1399392849-6021-1-git-send-email-loic.poulain-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2014-05-07  9:02   ` Johannes Berg
  2014-05-07  9:04     ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2014-05-07  9:02 UTC (permalink / raw)
  To: Loic Poulain; +Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA, linux-gpio

On Tue, 2014-05-06 at 18:14 +0200, Loic Poulain wrote:

> +	if (gpiod_cansleep(rfkill->shutdown_gpio))
> +		gpiod_set_value_cansleep(rfkill->shutdown_gpio, !blocked);
> +	else
> +		gpiod_set_value(rfkill->shutdown_gpio, !blocked);
> +
> +	if (gpiod_cansleep(rfkill->reset_gpio))
> +		gpiod_set_value_cansleep(rfkill->reset_gpio, !blocked);
> +	else
> +		gpiod_set_value(rfkill->reset_gpio, !blocked);

Really? I mean, there's not even a fallback where the cansleep() API
calls the non-sleeping one if the cansleep isn't support? This is really
ugly.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] rfkill-gpio: Use gpio cansleep version
  2014-05-07  9:02   ` [PATCH] rfkill-gpio: Use gpio cansleep version Johannes Berg
@ 2014-05-07  9:04     ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2014-05-07  9:04 UTC (permalink / raw)
  To: Loic Poulain; +Cc: linux-wireless, linux-gpio

On Wed, 2014-05-07 at 11:02 +0200, Johannes Berg wrote:
> On Tue, 2014-05-06 at 18:14 +0200, Loic Poulain wrote:
> 
> > +	if (gpiod_cansleep(rfkill->shutdown_gpio))
> > +		gpiod_set_value_cansleep(rfkill->shutdown_gpio, !blocked);
> > +	else
> > +		gpiod_set_value(rfkill->shutdown_gpio, !blocked);
> > +
> > +	if (gpiod_cansleep(rfkill->reset_gpio))
> > +		gpiod_set_value_cansleep(rfkill->reset_gpio, !blocked);
> > +	else
> > +		gpiod_set_value(rfkill->reset_gpio, !blocked);
> 
> Really? I mean, there's not even a fallback where the cansleep() API
> calls the non-sleeping one if the cansleep isn't support? This is really
> ugly.

Actually, it looks like unconditionally using the cansleep API should be
fine since it just calls the same internal helper function. Please
respin.

johannes


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

end of thread, other threads:[~2014-05-07  9:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1399392849-6021-1-git-send-email-loic.poulain@intel.com>
     [not found] ` <1399392849-6021-1-git-send-email-loic.poulain-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-05-07  9:02   ` [PATCH] rfkill-gpio: Use gpio cansleep version Johannes Berg
2014-05-07  9:04     ` Johannes Berg

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