From: Simon Horman <horms@kernel.org>
To: a0987203069@gmail.com
Cc: Simon Horman <horms@kernel.org>,
richardcochran@gmail.com, devicetree@vger.kernel.org,
edumazet@google.com, linux-stm32@st-md-mailman.stormreply.com,
joabreu@synopsys.com, linux-kernel@vger.kernel.org,
krzk+dt@kernel.org, pabeni@redhat.com, kuba@kernel.org,
andrew+netdev@lunn.ch, netdev@vger.kernel.org,
conor+dt@kernel.org, schung@nuvoton.com,
linux-arm-kernel@lists.infradead.org, davem@davemloft.net,
robh@kernel.org, yclu4@nuvoton.com, andrew@lunn.ch,
mcoquelin.stm32@gmail.com, ychuang3@nuvoton.com,
openbmc@lists.ozlabs.org, peppe.cavallaro@st.com,
alexandre.torgue@foss.st.com
Subject: Re: [net-next,v14,3/3] net: stmmac: dwmac-nuvoton: Add dwmac glue for Nuvoton MA35 family
Date: Wed, 18 Mar 2026 08:23:46 +0000 [thread overview]
Message-ID: <20260318082346.1825390-1-horms@kernel.org> (raw)
In-Reply-To: <20260316055427.1310569-4-a0987203069@gmail.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: stmmac: dwmac-nuvoton: Add dwmac glue for Nuvoton MA35 family
Add support for Gigabit Ethernet on Nuvoton MA35 series using dwmac
driver.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
> --- a/drivers/net/ethernet/stmicro/stmmac/Makefile
> +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-nuvoton.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-nuvoton.c
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-nuvoton.c
> @@ -0,0 +1,136 @@
[ ... ]
> +static int nvt_gmac_probe(struct platform_device *pdev)
> +{
> + struct plat_stmmacenet_data *plat_dat;
> + struct stmmac_resources stmmac_res;
> + struct device *dev = &pdev->dev;
> + struct nvt_priv_data *priv;
> + int ret;
> +
> + ret = stmmac_get_platform_resources(pdev, &stmmac_res);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to get platform resources\n");
> +
> + plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
> + if (IS_ERR(plat_dat))
> + return dev_err_probe(dev, PTR_ERR(plat_dat), "Failed to get platform data\n");
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return dev_err_probe(dev, -ENOMEM, "Failed to allocate private data\n");
> +
> + priv->regmap = syscon_regmap_lookup_by_phandle_args(dev->of_node, "nuvoton,sys",
> + 1, &priv->macid);
> + if (IS_ERR(priv->regmap))
> + ret = dev_err_probe(dev, PTR_ERR(priv->regmap), "Failed to get sys register\n");
> +
> + if (priv->macid > 1)
> + ret = dev_err_probe(dev, -EINVAL, "Invalid sys arguments\n");
> ^^^^
Does this code return the error on failure? The dev_err_probe() result is
assigned to ret but the function continues execution without returning.
Russell King's v12 review suggested using set_phy_intf_sel callback,
which led to significant refactoring in v12. This refactoring appears to
have inadvertently broken the error handling here and below.
The code should be:
if (IS_ERR(priv->regmap))
return dev_err_probe(dev, PTR_ERR(priv->regmap), "Failed to get sys register\n");
if (priv->macid > 1)
return dev_err_probe(dev, -EINVAL, "Invalid sys arguments\n");
See Russell's v12 review:
https://lore.kernel.org/netdev/aYsurPBMnzWDZCco@shell.armlinux.org.uk/
> +
> + plat_dat->bsp_priv = priv;
> + plat_dat->set_phy_intf_sel = nvt_set_phy_intf_sel;
> +
> + return stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
> +}
[ ... ]
next prev parent reply other threads:[~2026-03-18 8:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 5:54 [PATCH net-next v14 0/3] Add support for Nuvoton MA35D1 GMAC Joey Lu
2026-03-16 5:54 ` [PATCH net-next v14 1/3] dt-bindings: net: nuvoton: Add schema for Nuvoton MA35 family GMAC Joey Lu
2026-03-16 5:54 ` [PATCH net-next v14 2/3] arm64: dts: nuvoton: Add Ethernet nodes Joey Lu
2026-03-16 5:54 ` [PATCH net-next v14 3/3] net: stmmac: dwmac-nuvoton: Add dwmac glue for Nuvoton MA35 family Joey Lu
2026-03-18 8:23 ` Simon Horman [this message]
2026-03-23 6:31 ` [net-next,v14,3/3] " Joey Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260318082346.1825390-1-horms@kernel.org \
--to=horms@kernel.org \
--cc=a0987203069@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=schung@nuvoton.com \
--cc=ychuang3@nuvoton.com \
--cc=yclu4@nuvoton.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox