[PATCH 05/33] gpio: add generic single-register fixed-direction GPIO driver

Linus Walleij linus.walleij at linaro.org
Tue Aug 30 14:47:09 PDT 2016


On Tue, Aug 30, 2016 at 11:42 PM, Russell King - ARM Linux
<linux at armlinux.org.uk> wrote:
> On Tue, Aug 30, 2016 at 11:25:19PM +0200, Linus Walleij wrote:

>> > +#define to_gpio_reg(x) container_of(x, struct gpio_reg, gc)
>>
>> You don't need that trickery anymore, just:
>>
>> > +static int gpio_reg_get_direction(struct gpio_chip *gc, unsigned offset)
>> > +{
>> > +       struct gpio_reg *r = to_gpio_reg(gc);
>>
>> struct gpio_reg *r = gpiochip_get_data(gc);
>>
>> (applied everywhere)
>
> I prefer my method by a long shot

Sure it's no strong preference. Keep it like this if you like.
I'm very happy with the series either way!

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list