diff mbox series

[net-next,2/2] net: stmmac: dwmac-stm32: update err status in case different of stm32mp13

Message ID 20240627084917.327592-3-christophe.roullier@foss.st.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Fixes for stm32-dwmac driver fails to probe | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 842 this patch: 842
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 849 this patch: 849
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes fail Problems with Fixes tag: 1
netdev/build_allmodconfig_warn success Errors and warnings before: 849 this patch: 849
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-06-27--12-00 (tests: 664)

Commit Message

Christophe Roullier June 27, 2024, 8:49 a.m. UTC
Second parameter of syscfg property (mask) is mandatory for MP13 but
optional for all other cases so need to re init err to 0 for this case
to avoid parse issue.

Fixes: 50bbc0393114 ("net: stmmac: dwmac-stm32: add management of stm32mp13 for stm32")

Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Marek Vasut June 27, 2024, 3:08 p.m. UTC | #1
On 6/27/24 10:49 AM, Christophe Roullier wrote:
> Second parameter of syscfg property (mask) is mandatory for MP13 but
> optional for all other cases so need to re init err to 0 for this case
> to avoid parse issue.

What parse issue ? Please expand this part of the commit message.

Basically if this is not MP13, and the dev_dbg() is hit, 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.

With the commit message updated:

Reviewed-by: Marek Vasut <marex@denx.de>

[...]
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
index 8b85265ca6cf..d060d1d8bfc6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
@@ -371,10 +371,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;