* [PATCH -next] net: stmmac: Fix an error code in dwmac-ingenic.c
@ 2021-06-16 2:39 Yang Li
2021-06-24 14:25 ` Andrew Lunn
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-06-16 2:39 UTC (permalink / raw)
To: peppe.cavallaro
Cc: alexandre.torgue, joabreu, davem, kuba, mcoquelin.stm32, netdev,
linux-stm32, linux-arm-kernel, linux-kernel, Yang Li
When IS_ERR(mac->regmap) returns true, the value of ret is 0.
So, we set ret to -ENODEV to indicate this error.
Clean up smatch warning:
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:266
ingenic_mac_probe() warn: missing error code 'ret'
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
index 60984c1..f3950e0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
@@ -263,6 +263,7 @@ static int ingenic_mac_probe(struct platform_device *pdev)
mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg");
if (IS_ERR(mac->regmap)) {
dev_err(&pdev->dev, "%s: Failed to get syscon regmap\n", __func__);
+ ret = -ENODEV;
goto err_remove_config_dt;
}
--
1.8.3.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] net: stmmac: Fix an error code in dwmac-ingenic.c
2021-06-16 2:39 [PATCH -next] net: stmmac: Fix an error code in dwmac-ingenic.c Yang Li
@ 2021-06-24 14:25 ` Andrew Lunn
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Lunn @ 2021-06-24 14:25 UTC (permalink / raw)
To: Yang Li
Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, kuba,
mcoquelin.stm32, netdev, linux-stm32, linux-arm-kernel,
linux-kernel
On Wed, Jun 16, 2021 at 10:39:08AM +0800, Yang Li wrote:
> When IS_ERR(mac->regmap) returns true, the value of ret is 0.
> So, we set ret to -ENODEV to indicate this error.
>
> Clean up smatch warning:
> drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:266
> ingenic_mac_probe() warn: missing error code 'ret'
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
> index 60984c1..f3950e0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
> @@ -263,6 +263,7 @@ static int ingenic_mac_probe(struct platform_device *pdev)
> mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg");
> if (IS_ERR(mac->regmap)) {
> dev_err(&pdev->dev, "%s: Failed to get syscon regmap\n", __func__);
> + ret = -ENODEV;
mac->regmap is a ERR_PTR(), containing an error code. Please use that
error code, not ENODEV.
Andrew
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-24 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 2:39 [PATCH -next] net: stmmac: Fix an error code in dwmac-ingenic.c Yang Li
2021-06-24 14:25 ` Andrew Lunn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).