diff mbox series

[net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()

Message ID 20210608135718.3009950-1-yangyingliang@huawei.com
State New
Headers show
Series [net-next] sh_eth: Use devm_platform_get_and_ioremap_resource() | expand

Commit Message

Yang Yingliang June 8, 2021, 1:57 p.m. UTC
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/renesas/sh_eth.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Sergei Shtylyov June 8, 2021, 3:55 p.m. UTC | #1
Hello!

On 6/8/21 4:57 PM, Yang Yingliang wrote:

> Use devm_platform_get_and_ioremap_resource() to simplify
> code.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Sergei Shtylyov <sergei.shtylyov@gmail.com>

  Is my understanding correct that you tried to convert the ravb driver too
(and failed)?

MBR, Sergei
patchwork-bot+netdevbpf@kernel.org June 8, 2021, 11:40 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 8 Jun 2021 21:57:18 +0800 you wrote:
> Use devm_platform_get_and_ioremap_resource() to simplify
> code.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/ethernet/renesas/sh_eth.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Here is the summary with links:
  - [net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()
    https://git.kernel.org/netdev/net-next/c/52481e585951

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
diff mbox series

Patch

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index c5b154868c1f..177523be4fb6 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -3225,9 +3225,6 @@  static int sh_eth_drv_probe(struct platform_device *pdev)
 	struct net_device *ndev;
 	int ret;
 
-	/* get base addr */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
 	ndev = alloc_etherdev(sizeof(struct sh_eth_private));
 	if (!ndev)
 		return -ENOMEM;
@@ -3245,7 +3242,7 @@  static int sh_eth_drv_probe(struct platform_device *pdev)
 	mdp = netdev_priv(ndev);
 	mdp->num_tx_ring = TX_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)) {
 		ret = PTR_ERR(mdp->addr);
 		goto out_release;