* [PATCH net-next] net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify code
@ 2019-08-21 13:51 YueHaibing
2019-08-21 14:03 ` Neil Armstrong
2019-08-21 20:53 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2019-08-21 13:51 UTC (permalink / raw)
To: davem, peppe.cavallaro, alexandre.torgue, joabreu, khilman,
mcoquelin.stm32
Cc: netdev, YueHaibing, linux-kernel, linux-amlogic, linux-stm32,
linux-arm-kernel
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
index 786ca4a..9cda29e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
@@ -308,7 +308,6 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
{
struct plat_stmmacenet_data *plat_dat;
struct stmmac_resources stmmac_res;
- struct resource *res;
struct meson8b_dwmac *dwmac;
int ret;
@@ -332,8 +331,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
ret = -EINVAL;
goto err_remove_config_dt;
}
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- dwmac->regs = devm_ioremap_resource(&pdev->dev, res);
+ dwmac->regs = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(dwmac->regs)) {
ret = PTR_ERR(dwmac->regs);
goto err_remove_config_dt;
--
2.7.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify code
2019-08-21 13:51 [PATCH net-next] net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify code YueHaibing
@ 2019-08-21 14:03 ` Neil Armstrong
2019-08-21 20:53 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2019-08-21 14:03 UTC (permalink / raw)
To: YueHaibing, davem, peppe.cavallaro, alexandre.torgue, joabreu,
khilman, mcoquelin.stm32
Cc: netdev, linux-stm32, linux-kernel, linux-arm-kernel, linux-amlogic
On 21/08/2019 15:51, YueHaibing wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> index 786ca4a..9cda29e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
> @@ -308,7 +308,6 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
> {
> struct plat_stmmacenet_data *plat_dat;
> struct stmmac_resources stmmac_res;
> - struct resource *res;
> struct meson8b_dwmac *dwmac;
> int ret;
>
> @@ -332,8 +331,7 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
> ret = -EINVAL;
> goto err_remove_config_dt;
> }
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - dwmac->regs = devm_ioremap_resource(&pdev->dev, res);
> + dwmac->regs = devm_platform_ioremap_resource(pdev, 1);
> if (IS_ERR(dwmac->regs)) {
> ret = PTR_ERR(dwmac->regs);
> goto err_remove_config_dt;
>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify code
2019-08-21 13:51 [PATCH net-next] net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-08-21 14:03 ` Neil Armstrong
@ 2019-08-21 20:53 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-08-21 20:53 UTC (permalink / raw)
To: yuehaibing
Cc: alexandre.torgue, khilman, linux-kernel, joabreu,
mcoquelin.stm32, netdev, peppe.cavallaro, linux-amlogic,
linux-stm32, linux-arm-kernel
From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 21 Aug 2019 21:51:30 +0800
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-21 20:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 13:51 [PATCH net-next] net: stmmac: dwmac-meson8b: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-08-21 14:03 ` Neil Armstrong
2019-08-21 20:53 ` David Miller
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).