ethernet: marvell: remove unnecessary check
authorVarka Bhadram <varkabhadram@gmail.com>
Fri, 24 Oct 2014 02:12:08 +0000 (07:42 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Oct 2014 23:16:01 +0000 (19:16 -0400)
devm_ioremap_resource checks platform_get_resource() return value.
We can remove the duplicate check here.

Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/pxa168_eth.c

index bee4c369f0fe56f800c91acdcdf6b287dd30f348..21ddecef151e571c8e100ff1a5d01531d367eed4 100644 (file)
@@ -1450,16 +1450,14 @@ static int pxa168_eth_probe(struct platform_device *pdev)
        pep = netdev_priv(dev);
        pep->dev = dev;
        pep->clk = clk;
+
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (res == NULL) {
-               err = -ENODEV;
-               goto err_netdev;
-       }
        pep->base = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(pep->base)) {
                err = -ENOMEM;
                goto err_netdev;
        }
+
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        BUG_ON(!res);
        dev->irq = res->start;