Re: [PATCH 1/3] drivers: pinctrl sleep and idle states in the core

From: Linus Walleij
Date: Sun Jun 16 2013 - 06:55:44 EST


On Fri, Jun 14, 2013 at 12:02 AM, Stephen Warren <swarren@xxxxxxxxxxxxx> wrote:
> On 06/11/2013 02:28 AM, Linus Walleij wrote:
>> I tried to create a refactoring patch for this but couldn't come
>> up with anything apropriate along the lines above. For example
>> this function:
> ...
>
> Don't you just want something very roughly like:
>
> int pinctrl_pm_select_xxx_state(struct device *dev,
> unsigned long offset, char *name)
> {
> struct dev_pin_info *pins = dev->pins;
> struct pinctrl_state **s = (void *)(((char *)pins) + offset)
(...)
> return pinctrl_pm_select_xxx_state(dev,
> offsetof(struct dev_pin_info, default_state),
> "default");
> }

Argh that seems a bit too esoteric to save these few
lines, maybe it's me being too stupid to parse this
but it makes the code less maintainable for the pinctrl
maintainer atleast so will not happen right now.

But it is clever still. :-)

Yours,
Linus Walleij
--
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/