lkml.org 
[lkml]   [2013]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/3] drivers: pinctrl sleep and idle states in the core
From
On Fri, Jun 14, 2013 at 12:02 AM, Stephen Warren <swarren@wwwdotorg.org> 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


\
 
 \ /
  Last update: 2013-06-16 13:21    [W:0.045 / U:1.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site