Messages in this thread | | | Subject | RE: [PATCH] gpiolib: introduce for_each_gpio_in_chip macro | Date | Tue, 4 Aug 2009 20:48:49 -0400 | From | "H Hartley Sweeten" <> |
| |
On Tuesday, August 04, 2009 2:14 PM, David Brownell wrote: > On Friday 31 July 2009, H Hartley Sweeten wrote: >> gpiolib: introduce for_each_gpio_in_chip macro >> >> There are a number of places in gpiolib where all the gpio's handled by a >> chip are walked thru using a for() loop. This introduces a for_each_* >> macro to clarify the code. > > I'd rather not. There are four such loops, and these are > really simple iterators. Such a macro IMO just obfuscates, > when it's just hiding such trivial index ops. > > NAK.
Ok.
For the record. The reason I sent this is I'm trying to work out an extension to gpiolib that adds gpio_port_* access to the API. Most of the gpiolib drivers already the necessary logic since the raw I/O is performed on the entire 'chip'. The API just needs the extensions added to request/free the port, set the direction and get/set the value.
Is this a worthwhile addition?
Regards, Hartley
| |