net: w5300: Use devm_ioremap_resource()
authorJingoo Han <jg1.han@samsung.com>
Fri, 28 Feb 2014 05:47:47 +0000 (14:47 +0900)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Feb 2014 21:57:24 +0000 (16:57 -0500)
Use devm_ioremap_resource() in order to make the code simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/wiznet/w5300.c

index 71c27b3292f1318a30a26dcd25d277dfcc5bd119..1f33c4c86c207f6a4fecf52bca8645c5e114be9e 100644 (file)
@@ -561,11 +561,10 @@ static int w5300_hw_probe(struct platform_device *pdev)
        if (!mem)
                return -ENXIO;
        mem_size = resource_size(mem);
-       if (!devm_request_mem_region(&pdev->dev, mem->start, mem_size, name))
-               return -EBUSY;
-       priv->base = devm_ioremap(&pdev->dev, mem->start, mem_size);
-       if (!priv->base)
-               return -EBUSY;
+
+       priv->base = devm_ioremap_resource(&pdev->dev, mem);
+       if (IS_ERR(priv->base))
+               return PTR_ERR(priv->base);
 
        spin_lock_init(&priv->reg_lock);
        priv->indirect = mem_size < W5300_BUS_DIRECT_SIZE;