RE: [PATCH] gpiolib: introduce for_each_gpio_in_chip macro

From: H Hartley Sweeten
Date: Tue Aug 04 2009 - 20:49:01 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/