ethernet: wiznet: remove unnecessary check
authorVarka Bhadram <varkabhadram@gmail.com>
Fri, 24 Oct 2014 02:12:06 +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/wiznet/w5100.c
drivers/net/ethernet/wiznet/w5300.c

index 0f56b1c0e08203ea4fdc6dd29b54480bdd87a41b..70a930ac4fa9a0d113de07f3b6d52775312defc3 100644 (file)
@@ -638,14 +638,12 @@ static int w5100_hw_probe(struct platform_device *pdev)
        }
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!mem)
-               return -ENXIO;
-       mem_size = resource_size(mem);
-
        priv->base = devm_ioremap_resource(&pdev->dev, mem);
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
+       mem_size = resource_size(mem);
+
        spin_lock_init(&priv->reg_lock);
        priv->indirect = mem_size < W5100_BUS_DIRECT_SIZE;
        if (priv->indirect) {
index f961f14a047343e7b06a3ea6601656e7ce2c139b..7974b7d90fccd0525f3b1830995ba0accb8ed8a6 100644 (file)
@@ -558,14 +558,12 @@ static int w5300_hw_probe(struct platform_device *pdev)
        }
 
        mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!mem)
-               return -ENXIO;
-       mem_size = resource_size(mem);
-
        priv->base = devm_ioremap_resource(&pdev->dev, mem);
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
+       mem_size = resource_size(mem);
+
        spin_lock_init(&priv->reg_lock);
        priv->indirect = mem_size < W5300_BUS_DIRECT_SIZE;
        if (priv->indirect) {