Re: [PATCH v2] gpio: mt7621: support gpio-line-names property
From: Andy Shevchenko
Date: Sat Jul 03 2021 - 07:32:49 EST
On Sat, Jul 3, 2021 at 2:06 PM Sergio Paracuellos
<sergio.paracuellos@xxxxxxxxx> wrote:
> On Fri, Jul 2, 2021 at 1:30 PM Sergio Paracuellos
> <sergio.paracuellos@xxxxxxxxx> wrote:
...
> - ret = devprop_gpiochip_set_names(gc);
> + ret = devprop_gpiochip_set_names(gc, 0);
I had been expecting that this parameter would be in the field of the gpiochip.
...
> The problem I see with this approach is that
> 'devprop_gpiochip_set_names' already trusts in gpio_device already
> created and this happens in 'gpiochip_add_data_with_key'. So doing in
> this way force "broken drivers" to call this new
> 'devprop_gpiochip_set_names_base' function after
> 'devm_gpiochip_add_data' is called so the core code has already set up
> the friendly names repeated for all gpio chip banks and the approach
> would be to "overwrite" those in a second pass which sounds more like
> a hack than a solution.
>
> But maybe I am missing something in what you were pointing out here.
Would the above work?
--
With Best Regards,
Andy Shevchenko