Skip to content

Commit

Permalink
ethernet: wiznet: remove unnecessary check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Varka Bhadram authored and David S. Miller committed Oct 27, 2014
1 parent 9585011 commit 5e9b4dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/wiznet/w5100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/ethernet/wiznet/w5300.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5e9b4dc

Please sign in to comment.