Skip to content

Commit

Permalink
ethernet: renesas: 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 7e5ae24 commit c960804
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/net/ethernet/renesas/sh_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -2769,10 +2769,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)

/* get base addr */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (unlikely(res == NULL)) {
dev_err(&pdev->dev, "invalid resource\n");
return -EINVAL;
}

ndev = alloc_etherdev(sizeof(struct sh_eth_private));
if (!ndev)
Expand All @@ -2781,8 +2777,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);

/* The sh Ether-specific entries in the device structure. */
ndev->base_addr = res->start;
devno = pdev->id;
if (devno < 0)
devno = 0;
Expand All @@ -2806,6 +2800,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
goto out_release;
}

ndev->base_addr = res->start;

spin_lock_init(&mdp->lock);
mdp->pdev = pdev;

Expand Down

0 comments on commit c960804

Please sign in to comment.