From d1b44ce1a37ee667dfdd0770c6f0b08dae7ebad8 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 28 Feb 2014 14:47:47 +0900 Subject: [PATCH] net: w5300: Use devm_ioremap_resource() Use devm_ioremap_resource() in order to make the code simpler. Signed-off-by: Jingoo Han Signed-off-by: David S. Miller --- drivers/net/ethernet/wiznet/w5300.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c index 71c27b3292f1..1f33c4c86c20 100644 --- a/drivers/net/ethernet/wiznet/w5300.c +++ b/drivers/net/ethernet/wiznet/w5300.c @@ -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; -- 2.30.2