Hi Ilya,

On Mon, 2021-04-05 at 22:53 -0700, Ilya Lipnitskiy wrote:
> DTS properties that match *-gpios are treated specially.
> 
> Use ngpios instead, as most GPIO drivers upstream do.
> 
> Fixes 5.10 DTS errors such as:
>   OF: /palmbus@300000/gpio@600: could not find phandle
> 
> Fixes DTC warnings such as:
>   Warning (gpios_property): /palmbus@300000/gpio@600:ralink,num-
> gpios:
>   Could not get phandle node for (cell 0)
> 
> Signed-off-by: Ilya Lipnitskiy <[email protected]>
> Cc: Daniel Golle <[email protected]>
> ---
> 

[...]

> diff --git a/target/linux/ramips/patches-5.10/802-GPIO-MIPS-ralink-
> add-gpio-driver-for-ralink-SoC.patch b/target/linux/ramips/patches-
> 5.10/802-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
> index 141d29f9401c..c173336924d2 100644
> --- a/target/linux/ramips/patches-5.10/802-GPIO-MIPS-ralink-add-gpio-
> driver-for-ralink-SoC.patch
> +++ b/target/linux/ramips/patches-5.10/802-GPIO-MIPS-ralink-add-gpio-
> driver-for-ralink-SoC.patch
> @@ -357,7 +357,7 @@ Cc: [email protected]
>  +              return -EINVAL;
>  +      }
>  +
> -+      ngpio = of_get_property(np, "ralink,num-gpios", NULL);
> ++      ngpio = of_get_property(np, "ngpios", NULL);

I guess you just went for the smallest patch that fixes the errors and
warnings? Otherwise, if you use of_property_read_u32() here, you don't
have to deal with be32_to_cpu() later on.

Based on my recent experience with linux-gpio, I think more things
would need to change too, for the driver to be upstream-compatible. But
I don't know what your plans are with this driver, so maybe this quick
fix is sufficient for OpenWrt.

Best,
Sander



_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to