Re: [PATCH v2 1/1] i2c: designware: set pinctrl recovery information from device pinctrl

From: Andy Shevchenko
Date: Fri Dec 16 2022 - 09:46:53 EST


On Fri, Dec 16, 2022 at 03:50:19PM +0200, Hawa, Hanna wrote:
> On 12/15/2022 12:27 PM, Andy Shevchenko wrote:
> > OK, but why that function doesn't use the dev->pins->p if it's defined?
> > (As a fallback when rinfo->pinctrl is NULL. >
>
> The solution will look like the below diff (get_device_pinctrl() is new
> function that i've added that return the dev->pins->p)

Naming is not aligned with a namespace.

I would rather name it dev_pinctrl() and locate it in pinctrl/devinfo.h.

...

> - struct pinctrl *p = bri->pinctrl;
> + struct pinctrl *p;
> +
> + if (!bri->pinctrl)
> + bri->pinctrl = get_device_pinctrl(dev->parent);
> + p = bri->pinctrl;

Can be simplified with help of Elvis:

p = bri->pinctrl ?: dev_pinctrl(dev->parent);

> > Wolfram?
> >
> > Hanna, it seems you missed I²C maintainer to Cc...
>
> I based my CC/TO on get_maintainer.pl script. Will make sure that Wolfram on
> CC next time.

All the same about Linus W., who is pin control subsystem maintainer, and be
sure the respective mailing lists are also included.

--
With Best Regards,
Andy Shevchenko