Web lists-archives.org

Re: [PATCH soc-camera] Replace NO_GPIO with gpio_is_valid()




On Fri, 15 Feb 2008, Guennadi Liakhovetski wrote:
> Upon suggestion by David Brownell use a gpio_is_valid() predicate
> instead of an explicit NO_GPIO macro. The respective patch to
> include/asm-generic/gpio.h has been accepted upstream.
>
>  #else
> -	mt9m001->switch_gpio = NO_GPIO;
> +	mt9m001->switch_gpio = -EINVAL;
>  #endif

Is that part right?  I thought there would still be a NO_GPIO value for
when you wanted to set or return an invalid gpio number.  gpio_is_valid()
is a predicate so it doesn't help you create a gpio number that isn't valid
(other than something absurd like testing all unsigned ints for one that
fails), one still needs NO_GPIO or something like it.  Using NO_GPIO seems
like a better idea that hoping that -EINVAL happens to be invalid on every
platform.

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list