* [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-06 12:08 Yangtao Li
2023-07-06 12:08 ` [PATCH 2/4] tsnep: " Yangtao Li
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-06 12:08 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Michal Simek
Cc: Yangtao Li, netdev, linux-arm-kernel, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index ad2c30d9a482..3cba947e4cbd 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1114,8 +1114,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
ndev->irq = rc;
- res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
- lp->base_addr = devm_ioremap_resource(&ofdev->dev, res);
+ lp->base_addr = devm_platform_get_and_ioremap_resource(ofdev, 0, &res);
if (IS_ERR(lp->base_addr)) {
rc = PTR_ERR(lp->base_addr);
goto error;
--
2.39.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] tsnep: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:08 [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Yangtao Li
@ 2023-07-06 12:08 ` Yangtao Li
2023-07-06 12:08 ` [PATCH 3/4] net: wiznet: " Yangtao Li
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-06 12:08 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Yangtao Li, netdev, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/net/ethernet/engleder/tsnep_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/engleder/tsnep_main.c b/drivers/net/ethernet/engleder/tsnep_main.c
index 84751bb303a6..28a1a4f5d7b3 100644
--- a/drivers/net/ethernet/engleder/tsnep_main.c
+++ b/drivers/net/ethernet/engleder/tsnep_main.c
@@ -2487,8 +2487,7 @@ static int tsnep_probe(struct platform_device *pdev)
mutex_init(&adapter->rxnfc_lock);
INIT_LIST_HEAD(&adapter->rxnfc_rules);
- io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- adapter->addr = devm_ioremap_resource(&pdev->dev, io);
+ adapter->addr = devm_platform_get_and_ioremap_resource(pdev, 0, &io);
if (IS_ERR(adapter->addr))
return PTR_ERR(adapter->addr);
netdev->mem_start = io->start;
--
2.39.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] net: wiznet: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:08 [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 12:08 ` [PATCH 2/4] tsnep: " Yangtao Li
@ 2023-07-06 12:08 ` Yangtao Li
2023-07-06 12:08 ` [PATCH 4/4] net: ethernet: broadcom: Convert to devm_platform_ioremap_resource() Yangtao Li
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-06 12:08 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Yangtao Li, netdev, linux-kernel
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/net/ethernet/wiznet/w5300.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index b0958fe8111e..8ba931c98435 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -539,8 +539,7 @@ static int w5300_hw_probe(struct platform_device *pdev)
eth_hw_addr_random(ndev);
}
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- priv->base = devm_ioremap_resource(&pdev->dev, mem);
+ priv->base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
--
2.39.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] net: ethernet: broadcom: Convert to devm_platform_ioremap_resource()
2023-07-06 12:08 [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 12:08 ` [PATCH 2/4] tsnep: " Yangtao Li
2023-07-06 12:08 ` [PATCH 3/4] net: wiznet: " Yangtao Li
@ 2023-07-06 12:08 ` Yangtao Li
2023-07-06 12:29 ` [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Alexander Lobakin
2023-07-06 15:48 ` Jakub Kicinski
4 siblings, 0 replies; 6+ messages in thread
From: Yangtao Li @ 2023-07-06 12:08 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Yangtao Li, netdev, linux-kernel
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/net/ethernet/broadcom/bcm63xx_enet.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 2cf96892e565..e6b28077449b 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -2648,17 +2648,18 @@ static int bcm_enetsw_probe(struct platform_device *pdev)
struct bcm_enet_priv *priv;
struct net_device *dev;
struct bcm63xx_enetsw_platform_data *pd;
- struct resource *res_mem;
int ret, irq_rx, irq_tx;
if (!bcm_enet_shared_base[0])
return -EPROBE_DEFER;
- res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq_rx = platform_get_irq(pdev, 0);
+ if (irq_rx < 0)
+ return irq_rx;
+
irq_tx = platform_get_irq(pdev, 1);
- if (!res_mem || irq_rx < 0)
- return -ENODEV;
+ if (irq_tx < 0)
+ return irq_tx;
dev = alloc_etherdev(sizeof(*priv));
if (!dev)
@@ -2690,7 +2691,7 @@ static int bcm_enetsw_probe(struct platform_device *pdev)
if (ret)
goto out;
- priv->base = devm_ioremap_resource(&pdev->dev, res_mem);
+ priv->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->base)) {
ret = PTR_ERR(priv->base);
goto out;
--
2.39.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:08 [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (2 preceding siblings ...)
2023-07-06 12:08 ` [PATCH 4/4] net: ethernet: broadcom: Convert to devm_platform_ioremap_resource() Yangtao Li
@ 2023-07-06 12:29 ` Alexander Lobakin
2023-07-06 15:48 ` Jakub Kicinski
4 siblings, 0 replies; 6+ messages in thread
From: Alexander Lobakin @ 2023-07-06 12:29 UTC (permalink / raw)
To: Yangtao Li
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Michal Simek, netdev, linux-arm-kernel, linux-kernel
From: Yangtao Li <frank.li@vivo.com>
Date: Thu, 6 Jul 2023 20:08:47 +0800
> [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource()
Please clearly specify the target tree (net or net-next) in the subject
prefix. Since your series is cleanups, it should be "PATCH net-next".
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
> drivers/net/ethernet/xilinx/xilinx_emaclite.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> index ad2c30d9a482..3cba947e4cbd 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
> @@ -1114,8 +1114,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
>
> ndev->irq = rc;
>
> - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
> - lp->base_addr = devm_ioremap_resource(&ofdev->dev, res);
> + lp->base_addr = devm_platform_get_and_ioremap_resource(ofdev, 0, &res);
> if (IS_ERR(lp->base_addr)) {
> rc = PTR_ERR(lp->base_addr);
> goto error;
Thanks,
Olek
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource()
2023-07-06 12:08 [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Yangtao Li
` (3 preceding siblings ...)
2023-07-06 12:29 ` [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Alexander Lobakin
@ 2023-07-06 15:48 ` Jakub Kicinski
4 siblings, 0 replies; 6+ messages in thread
From: Jakub Kicinski @ 2023-07-06 15:48 UTC (permalink / raw)
To: Yangtao Li
Cc: David S. Miller, Eric Dumazet, Paolo Abeni, Michal Simek, netdev,
linux-arm-kernel, linux-kernel
On Thu, 6 Jul 2023 20:08:47 +0800 Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
## Form letter - net-next-closed
The merge window for v6.5 has begun and therefore net-next is closed
for new drivers, features, code refactoring and optimizations.
We are currently accepting bug fixes only.
Please repost when net-next reopens after July 10th.
RFC patches sent for review only are obviously welcome at any time.
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
--
pw-bot: defer
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-06 15:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-06 12:08 [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 12:08 ` [PATCH 2/4] tsnep: " Yangtao Li
2023-07-06 12:08 ` [PATCH 3/4] net: wiznet: " Yangtao Li
2023-07-06 12:08 ` [PATCH 4/4] net: ethernet: broadcom: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06 12:29 ` [PATCH 1/4] net: emaclite: Use devm_platform_get_and_ioremap_resource() Alexander Lobakin
2023-07-06 15:48 ` Jakub Kicinski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).