All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()
@ 2021-06-08 13:57 Yang Yingliang
  2021-06-08 15:55 ` Sergei Shtylyov
  2021-06-08 23:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2021-06-08 13:57 UTC (permalink / raw)
  To: linux-kernel, netdev; +Cc: sergei.shtylyov, davem, kuba

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(-)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()
  2021-06-08 13:57 [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
@ 2021-06-08 15:55 ` Sergei Shtylyov
  2021-06-08 23:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2021-06-08 15:55 UTC (permalink / raw)
  To: Yang Yingliang, linux-kernel, netdev; +Cc: davem, kuba

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource()
  2021-06-08 13:57 [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
  2021-06-08 15:55 ` Sergei Shtylyov
@ 2021-06-08 23:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-08 23:40 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, netdev, sergei.shtylyov, davem, kuba

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-08 23:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-08 13:57 [PATCH net-next] sh_eth: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
2021-06-08 15:55 ` Sergei Shtylyov
2021-06-08 23:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.