]> Git Repo - linux.git/commitdiff
phy: Sparx5 Eth SerDes: Fix return value check in sparx5_serdes_probe()
authorYang Yingliang <[email protected]>
Thu, 9 Sep 2021 07:21:49 +0000 (15:21 +0800)
committerVinod Koul <[email protected]>
Tue, 26 Oct 2021 11:06:23 +0000 (16:36 +0530)
In case of error, the function devm_ioremap() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.

Fixes: 2ff8a1eeb5aa ("phy: Add Sparx5 ethernet serdes PHY driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Yang Yingliang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
drivers/phy/microchip/sparx5_serdes.c

index 4076580fc2cd974c04e231ad7ae8d17c87206221..ab1b0986aa67167f9e773f64179e0b25b20d331e 100644 (file)
@@ -2475,10 +2475,10 @@ static int sparx5_serdes_probe(struct platform_device *pdev)
                return -EINVAL;
        }
        iomem = devm_ioremap(priv->dev, iores->start, resource_size(iores));
-       if (IS_ERR(iomem)) {
+       if (!iomem) {
                dev_err(priv->dev, "Unable to get serdes registers: %s\n",
                        iores->name);
-               return PTR_ERR(iomem);
+               return -ENOMEM;
        }
        for (idx = 0; idx < ARRAY_SIZE(sparx5_serdes_iomap); idx++) {
                struct sparx5_serdes_io_resource *iomap = &sparx5_serdes_iomap[idx];
This page took 0.061846 seconds and 4 git commands to generate.