[PATCH 13/15] gpio: sodaville: use new generic GPIO chip API

Bartosz Golaszewski brgl at bgdev.pl
Tue Sep 9 04:35:04 PDT 2025


On Tue, Sep 9, 2025 at 1:31 PM Andy Shevchenko
<andriy.shevchenko at intel.com> wrote:
>
> On Tue, Sep 09, 2025 at 11:15:40AM +0200, Bartosz Golaszewski wrote:
> >
> > Convert the driver to using the new generic GPIO chip interfaces from
> > linux/gpio/generic.h.
>
> ...
>
> > +     config = (typeof(config)){
>
> This looks unusual. Why can't properly formed compound literal be used as in
> many other places in the kernel?
>

It is correct C and checkpatch doesn't raise any warnings. It's the
same kind of argument as between kmalloc(sizeof(struct foo)) vs
kmalloc(sizeof(f)).

I guess it's personal taste but I like this version better.

Bartosz

> > +             .dev = &pdev->dev,
> > +             .sz = 4,
> > +             .dat = sd->gpio_pub_base + GPINR,
> > +             .set = sd->gpio_pub_base + GPOUTR,
> > +             .dirout = sd->gpio_pub_base + GPOER,
> > +     };



More information about the linux-riscv mailing list