Re: [PATCH 29/59] ARM: PXA: use gpio_set_value_cansleep() on pcm990

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <g.liakhovetski@xxxxxx>
> 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 <g.liakhovetski@xxxxxx>
> > Cc: Robert Jarzmik <robert.jarzmik@xxxxxxx>
> > Cc: Eric Miao <eric.y.miao@xxxxxxxxx>
> > ---
> >  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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux