summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bcm63xx_enet.c
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2013-08-19 15:20:39 +0400
committerDavid S. Miller <davem@davemloft.net>2013-08-21 10:22:16 +0400
commitf607e059505cd3c3e96096d09f5882eb6421320a (patch)
tree6628c673b8e1b599b570f96fa10ff0c47dec49f1 /drivers/net/ethernet/broadcom/bcm63xx_enet.c
parent84ce22df92f5cf9ecb76d53f4bf5f6d504684540 (diff)
downloadlinux-f607e059505cd3c3e96096d09f5882eb6421320a.tar.xz
bcm63xx_enet: replace devm_request_and_ioremap by devm_ioremap_resource
Use devm_ioremap_resource instead of devm_request_and_ioremap. This was done using the semantic patch scripts/coccinelle/api/devm_ioremap_resource.cocci The relevant call to platform_get_resource was manually moved down to the call to devm_ioremap_resource. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcm63xx_enet.c')
-rw-r--r--drivers/net/ethernet/broadcom/bcm63xx_enet.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index b1bcd4ba4744..89ff09ec7d28 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -1747,11 +1747,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (!bcm_enet_shared_base[0])
return -ENODEV;
- res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1);
res_irq_tx = platform_get_resource(pdev, IORESOURCE_IRQ, 2);
- if (!res_mem || !res_irq || !res_irq_rx || !res_irq_tx)
+ if (!res_irq || !res_irq_rx || !res_irq_tx)
return -ENODEV;
ret = 0;
@@ -1767,9 +1766,10 @@ static int bcm_enet_probe(struct platform_device *pdev)
if (ret)
goto out;
- priv->base = devm_request_and_ioremap(&pdev->dev, res_mem);
- if (priv->base == NULL) {
- ret = -ENOMEM;
+ res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ priv->base = devm_ioremap_resource(&pdev->dev, res_mem);
+ if (IS_ERR(priv->base)) {
+ ret = PTR_ERR(priv->base);
goto out;
}