Re: [PATCH] pinctrl: renesas: rzg2l: Handle non-unique subnode names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On Wed, Jul 5, 2023 at 11:41 AM <andy.shevchenko@xxxxxxxxx> wrote:
> Tue, Jul 04, 2023 at 12:18:58PM +0100, Biju Das kirjoitti:
> > Currently, sd1 and sd0 have unique subnode names 'sd1_mux' and 'sd0_mux'.
> > If we change it to a non-unique subnode name such as 'mux' this can lead
> > to the below conflicts as the RZ/G2L pin control driver considers only the
> > names of the subnodes.
> >
> >    pinctrl-rzg2l 11030000.pinctrl: pin P47_0 already requested by 11c00000.mmc; cannot claim for 11c10000.mmc
> >    pinctrl-rzg2l 11030000.pinctrl: pin-376 (11c10000.mmc) status -22
> >    pinctrl-rzg2l 11030000.pinctrl: could not request pin 376 (P47_0) from group mux  on device pinctrl-rzg2l
> >    renesas_sdhi_internal_dmac 11c10000.mmc: Error applying setting, reverse things back
> >
> > Fix this by constructing unique names from the node names of both the
> > pin control configuration node and its child node, where appropriate.
> >
> > Based on the work done by Geert for RZ/V2M pinctrl driver.
>
> ...
>
> > +     if (parent) {
> > +             name = devm_kasprintf(pctrl->dev, GFP_KERNEL, "%pOFn.%pOFn",
> > +                                   parent, np);
>
> Is devm_*() usage appropriate here?

I think so, as this is tied to the lifetime of the pin control driver, which you
cannot really remove/unbind without causing havoc.

Note that several other allocations already use devm_*(), too.

>
> > +             if (!name) {
> > +                     ret = -ENOMEM;
> > +                     goto done;
> > +             }
> > +     } else {
> > +             name = np->name;
> > +     }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux