lkml.org 
[lkml]   [2008]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/4] gpiolib: make gpio_to_chip() public
Date
On Wednesday 24 September 2008, Anton Vorontsov wrote:
> We'll need this function to write platform-specific hooks to deal
> with pin's dedicated functions. Quite obviously this will work only
> for the platforms with 1-to-1 GPIO to PIN mapping.
>
> This is stopgap solution till we think out and implement a proper
> api (pinlib?).
>
> p.s. This patch actually exports gpio_desc and places gpio_to_chip
> into the asm-generic/gpio.h as `static inline'. This is needed
> to not cause function calls for this trivial translation.
>
> Also, the patch does not export FLAG_*s... the names are too
> generic, and nobody is using them outside of gpiolib.c.

For the record: NAK, still. The concept has problems,
there is no "need" for this. I sketched a cleaner way
to address the issues of the QE USB driver; I'm sure it
would only take an hour or two to code, using what's
already present.

And if I were to approve something like this it would
be a lot simpler, not exposing internals, and with
appropriate kerneldoc. Simpler such as

struct gpio_chip *gpio_to_gpiochip(unsigned gpio)
{
return gpio_to_chip(gpio);
}
EXPORT_SYMBOL_NOTREALLY(gpio_to_gpiochip);

with a declaration in a header. It's not like THIS
version would be performance-critical (unlike the one
inside gpiolib).

- Dave


\
 
 \ /
  Last update: 2008-09-24 23:43    [W:0.034 / U:1.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site