]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: dwmac-stm32: update err status in case different of stm32mp13
authorChristophe Roullier <christophe.roullier@foss.st.com>
Mon, 1 Jul 2024 06:48:38 +0000 (08:48 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 2 Jul 2024 13:47:13 +0000 (15:47 +0200)
The mask parameter of syscfg property is mandatory for MP13 but
optional for all other cases.
The function should not return error code because for non-MP13
the missing syscfg phandle in DT is not considered an error.
So reset err to 0 in that case to support existing DTs without
syscfg phandle.

Fixes: 50bbc0393114 ("net: stmmac: dwmac-stm32: add management of stm32mp13 for stm32")
Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c

index d6a268237ca168d01a79b9ed8afd400abb307282..c1732955a697ed7a314e78b020fb19bc6240c8ec 100644 (file)
@@ -435,10 +435,12 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac,
        dwmac->mode_mask = SYSCFG_MP1_ETH_MASK;
        err = of_property_read_u32_index(np, "st,syscon", 2, &dwmac->mode_mask);
        if (err) {
-               if (dwmac->ops->is_mp13)
+               if (dwmac->ops->is_mp13) {
                        dev_err(dev, "Sysconfig register mask must be set (%d)\n", err);
-               else
+               } else {
                        dev_dbg(dev, "Warning sysconfig register mask not set\n");
+                       err = 0;
+               }
        }
 
        return err;