Hi Eric
On Wed, 3 Aug 2011, Eric Miao wrote:
> I'm not a big fan of this _cansleep() version of the API, is there any
> specific reason for doing so? Does the original code break anything?
Sure:
> > explicitly to avoid runtime warnings.
i.e., without this patch the
WARN_ON(chip->can_sleep);
in drivers/gpio/gpiolib.c::__gpio_set_value() triggers.
Thanks
Guennadi
>
> On Friday, July 29, 2011, Guennadi Liakhovetski <[email protected]>
> wrote:
> > Camera-switching GPIOs are provided by a i2c GPIO extender, switching
> > them can send the caller to sleep. Use the GPIO API *_cansleep methods
> > explicitly to avoid runtime warnings.
> >
> > Signed-off-by: Guennadi Liakhovetski <[email protected]>
> > Cc: Robert Jarzmik <[email protected]>
> > Cc: Eric Miao <[email protected]>
> > ---
> > arch/arm/mach-pxa/pcm990-baseboard.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c
> b/arch/arm/mach-pxa/pcm990-baseboard.c
> > index 6d5b7e0..8ad2597 100644
> > --- a/arch/arm/mach-pxa/pcm990-baseboard.c
> > +++ b/arch/arm/mach-pxa/pcm990-baseboard.c
> > @@ -395,9 +395,9 @@ static int pcm990_camera_set_bus_param(struct
> soc_camera_link *link,
> > }
> >
> > if (flags & SOCAM_DATAWIDTH_8)
> > - gpio_set_value(gpio_bus_switch, 1);
> > + gpio_set_value_cansleep(gpio_bus_switch, 1);
> > else
> > - gpio_set_value(gpio_bus_switch, 0);
> > + gpio_set_value_cansleep(gpio_bus_switch, 0);
> >
> > return 0;
> > }
> > --
> > 1.7.2.5
> >
> >
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html