Thread (14 messages) flat view 14 messages, 7 authors, 2013-06-17

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

From: Linus Walleij <hidden>
Date: 2013-06-16 10:55:27
Also in: lkml

On Fri, Jun 14, 2013 at 12:02 AM, Stephen Warren [off-list ref] wrote:
On 06/11/2013 02:28 AM, Linus Walleij wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help