On Thu, 27 Nov 2008, Anton Vorontsov wrote:
> This function is alike to the simple of_get_gpio(), but accepts new
> argument: flags. This new function will be used by the drivers that
> need to retrieve additional GPIO information, such as active-low flag.
>
> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>

So you want to do the clean up patch later?

> +     /*
> +      * We're discouraging gpio_cells < 2, since that way you'll have to
> +      * write your own xlate function (that will have to retrive the GPIO
> +      * number and the flags from a single gpio cell -- this is possible,
> +      * but not recommended).
> +      */
> +     if (of_gc->gpio_cells < 2) {
> +             WARN_ON(1);
> +             return -EINVAL;
> +     }

If you're not going to allow 1 cell anymore (which should perhaps be
mentioned in the changelog), you could just check that when the of_gpio
chip is registered.  There's no need to see if of_gc->gpio_cells has
changed each time a driver maps a GPIO.
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to