summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndy Shevchenko <andy.shevchenko@gmail.com>2021-05-10 12:58:08 +0300
committerDavid S. Miller <davem@davemloft.net>2021-05-11 00:47:23 +0300
commit584525554fd61040bbb28cd1280d07884ed148e8 (patch)
treed2ddc4b495f88fca732c676cc019ff3342afb663 /drivers
parentcf3399b731d36bc780803ff63e4d480a1efa33ac (diff)
downloadlinux-584525554fd61040bbb28cd1280d07884ed148e8.tar.xz
net: mvpp2: Unshadow error code of device_property_read_u32()
device_property_read_u32() may return different error codes. Propagate it to the caller. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index b6b7ba891e71..9f464e44ae1b 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -7458,10 +7458,12 @@ static int mvpp2_probe(struct platform_device *pdev)
/* Get system's tclk rate */
priv->tclk = clk_get_rate(priv->pp_clk);
- } else if (device_property_read_u32(&pdev->dev, "clock-frequency",
- &priv->tclk)) {
- dev_err(&pdev->dev, "missing clock-frequency value\n");
- return -EINVAL;
+ } else {
+ err = device_property_read_u32(&pdev->dev, "clock-frequency", &priv->tclk);
+ if (err) {
+ dev_err(&pdev->dev, "missing clock-frequency value\n");
+ return err;
+ }
}
if (priv->hw_version >= MVPP22) {