2021-06-08 13:56:21

by Yang Yingliang

[permalink] [raw]
Subject: [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()

Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <[email protected]>
---
drivers/net/ethernet/renesas/sh_eth.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

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;
--
2.25.1


2021-06-08 16:00:01

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()

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 <[email protected]>

Reviewed-by: Sergei Shtylyov <[email protected]>

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

MBR, Sergei

2021-06-09 16:57:49

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()

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 <[email protected]>
> ---
> 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