Message ID | 1311937019-29914-30-git-send-email-g.liakhovetski@gmx.de (mailing list archive) |
---|---|
State | RFC |
Headers | show |
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@gmx.de> > 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@gmx.de> > > Cc: Robert Jarzmik <robert.jarzmik@free.fr> > > Cc: Eric Miao <eric.y.miao@gmail.com> > > --- > > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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; }
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@gmx.de> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Eric Miao <eric.y.miao@gmail.com> --- arch/arm/mach-pxa/pcm990-baseboard.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)