Message ID | E1u3bfF-000Eli-C5@rmk-PC.armlinux.org.uk (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | net: stmmac: anarion: cleanups | expand |
On Sat, Apr 12, 2025 at 03:16:57PM +0100, Russell King (Oracle) wrote: > When enabled, print a user friendly description of the error when > failing to ioremap() the control resource, and use ERR_CAST() when > propagating the error. This allows us to get rid of the "err" local > variable in anarion_config_dt(). > > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c index 37fe7c288878..232aae752690 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c @@ -65,13 +65,12 @@ anarion_config_dt(struct platform_device *pdev, { struct anarion_gmac *gmac; void __iomem *ctl_block; - int err; ctl_block = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(ctl_block)) { - err = PTR_ERR(ctl_block); - dev_err(&pdev->dev, "Cannot get reset region (%d)!\n", err); - return ERR_PTR(err); + dev_err(&pdev->dev, "Cannot get reset region (%pe)!\n", + ctl_block); + return ERR_CAST(ctl_block); } gmac = devm_kzalloc(&pdev->dev, sizeof(*gmac), GFP_KERNEL);
When enabled, print a user friendly description of the error when failing to ioremap() the control resource, and use ERR_CAST() when propagating the error. This allows us to get rid of the "err" local variable in anarion_config_dt(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> --- drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)