ethernet: wiznet: remove unnecessary check
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>
This commit is contained in:
Родитель
958501163d
Коммит
5e9b4dce85
|
@ -638,14 +638,12 @@ static int w5100_hw_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
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);
|
priv->base = devm_ioremap_resource(&pdev->dev, mem);
|
||||||
if (IS_ERR(priv->base))
|
if (IS_ERR(priv->base))
|
||||||
return PTR_ERR(priv->base);
|
return PTR_ERR(priv->base);
|
||||||
|
|
||||||
|
mem_size = resource_size(mem);
|
||||||
|
|
||||||
spin_lock_init(&priv->reg_lock);
|
spin_lock_init(&priv->reg_lock);
|
||||||
priv->indirect = mem_size < W5100_BUS_DIRECT_SIZE;
|
priv->indirect = mem_size < W5100_BUS_DIRECT_SIZE;
|
||||||
if (priv->indirect) {
|
if (priv->indirect) {
|
||||||
|
|
|
@ -558,14 +558,12 @@ static int w5300_hw_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
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);
|
priv->base = devm_ioremap_resource(&pdev->dev, mem);
|
||||||
if (IS_ERR(priv->base))
|
if (IS_ERR(priv->base))
|
||||||
return PTR_ERR(priv->base);
|
return PTR_ERR(priv->base);
|
||||||
|
|
||||||
|
mem_size = resource_size(mem);
|
||||||
|
|
||||||
spin_lock_init(&priv->reg_lock);
|
spin_lock_init(&priv->reg_lock);
|
||||||
priv->indirect = mem_size < W5300_BUS_DIRECT_SIZE;
|
priv->indirect = mem_size < W5300_BUS_DIRECT_SIZE;
|
||||||
if (priv->indirect) {
|
if (priv->indirect) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче