Commit 52481e58 authored by Yang Yingliang's avatar Yang Yingliang Committed by David S. Miller

sh_eth: Use devm_platform_get_and_ioremap_resource()

Use devm_platform_get_and_ioremap_resource() to simplify
code.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarSergei Shtylyov <sergei.shtylyov@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5b38b97f
...@@ -3225,9 +3225,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -3225,9 +3225,6 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
struct net_device *ndev; struct net_device *ndev;
int ret; int ret;
/* get base addr */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ndev = alloc_etherdev(sizeof(struct sh_eth_private)); ndev = alloc_etherdev(sizeof(struct sh_eth_private));
if (!ndev) if (!ndev)
return -ENOMEM; return -ENOMEM;
...@@ -3245,7 +3242,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev) ...@@ -3245,7 +3242,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
mdp = netdev_priv(ndev); mdp = netdev_priv(ndev);
mdp->num_tx_ring = TX_RING_SIZE; mdp->num_tx_ring = TX_RING_SIZE;
mdp->num_rx_ring = RX_RING_SIZE; mdp->num_rx_ring = RX_RING_SIZE;
mdp->addr = devm_ioremap_resource(&pdev->dev, res); mdp->addr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(mdp->addr)) { if (IS_ERR(mdp->addr)) {
ret = PTR_ERR(mdp->addr); ret = PTR_ERR(mdp->addr);
goto out_release; goto out_release;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment