On Thu, Mar 3, 2022 at 7:22 AM Jianqun Xu <jay.xu@xxxxxxxxxxxxxx> wrote: > The dt nodes for rockchip soc designes as > > pinctrl: pinctrl { > gpio { > gpio-ranges = <&pinctrl xxx>; > }; > }; > > Currently, we get the pinctrl dt node from parent of gpio, this patch > try to get pinctrl dt node from 'gpio-ranges' property. > > After this patch, the dt nodes possible to be > > gpio { > gpio-ranges = <&pinctrl xxx>; > }; > > pinctrl: pinctrl { > > }; > > then the gpio driver could register as platform device itself, but not > populate from pinctrl driver. > > Signed-off-by: Jianqun Xu <jay.xu@xxxxxxxxxxxxxx> (...) > - if (!np || !pctlnp) > - return -ENODEV; > + pctlnp = of_parse_phandle(np, "gpio-ranges", 0); > + if (!pctlnp) > + pctlnp = of_get_parent(np); GPIO ranges can be several and point to several different pin controllers. I understand it does not in your case, so I guess it is fine if Heiko is fine with it. Yours, Linus Walleij