diff mbox series

[net-next] net: ethernet: ti: cpsw: Use devm_platform_get_and_ioremap_resource()

Message ID 20210609140152.3198309-1-yangyingliang@huawei.com (mailing list archive)
State Accepted
Commit aced6d37df797db46fa4d3540f657e8e46f2667c
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: ethernet: ti: cpsw: Use devm_platform_get_and_ioremap_resource() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 10 maintainers not CCed: zhangchangzhong@huawei.com brouer@redhat.com lorenzo@kernel.org michael@walle.cc daniel@iogearbox.net camelia.groza@nxp.com shayagr@amazon.com yanaijie@huawei.com m-karicheri2@ti.com linux-omap@vger.kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Yang Yingliang June 9, 2021, 2:01 p.m. UTC
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/net/ethernet/ti/cpsw.c     | 3 +--
 drivers/net/ethernet/ti/cpsw_new.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

Comments

Grygorii Strashko June 9, 2021, 5:18 p.m. UTC | #1
On 09/06/2021 17:01, Yang Yingliang wrote:
> Use devm_platform_get_and_ioremap_resource() to simplify
> code.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>   drivers/net/ethernet/ti/cpsw.c     | 3 +--
>   drivers/net/ethernet/ti/cpsw_new.c | 3 +--
>   2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index c0cd7de88316..b1e80cc96f56 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -1532,8 +1532,7 @@ static int cpsw_probe(struct platform_device *pdev)
>   	}
>   	cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000;
>   
> -	ss_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	ss_regs = devm_ioremap_resource(dev, ss_res);
> +	ss_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &ss_res);
>   	if (IS_ERR(ss_regs))
>   		return PTR_ERR(ss_regs);
>   	cpsw->regs = ss_regs;
> diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
> index 69b7a4e0220a..8d4f3c53385d 100644
> --- a/drivers/net/ethernet/ti/cpsw_new.c
> +++ b/drivers/net/ethernet/ti/cpsw_new.c
> @@ -1883,8 +1883,7 @@ static int cpsw_probe(struct platform_device *pdev)
>   	}
>   	cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000;
>   
> -	ss_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	ss_regs = devm_ioremap_resource(dev, ss_res);
> +	ss_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &ss_res);
>   	if (IS_ERR(ss_regs)) {
>   		ret = PTR_ERR(ss_regs);
>   		return ret;
> 

Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
patchwork-bot+netdevbpf@kernel.org June 10, 2021, 8:40 p.m. UTC | #2
Hello:

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

On Wed, 9 Jun 2021 22:01:52 +0800 you wrote:
> Use devm_platform_get_and_ioremap_resource() to simplify
> code.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/net/ethernet/ti/cpsw.c     | 3 +--
>  drivers/net/ethernet/ti/cpsw_new.c | 3 +--
>  2 files changed, 2 insertions(+), 4 deletions(-)

Here is the summary with links:
  - [net-next] net: ethernet: ti: cpsw: Use devm_platform_get_and_ioremap_resource()
    https://git.kernel.org/netdev/net-next/c/aced6d37df79

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/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c0cd7de88316..b1e80cc96f56 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1532,8 +1532,7 @@  static int cpsw_probe(struct platform_device *pdev)
 	}
 	cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000;
 
-	ss_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ss_regs = devm_ioremap_resource(dev, ss_res);
+	ss_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &ss_res);
 	if (IS_ERR(ss_regs))
 		return PTR_ERR(ss_regs);
 	cpsw->regs = ss_regs;
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 69b7a4e0220a..8d4f3c53385d 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -1883,8 +1883,7 @@  static int cpsw_probe(struct platform_device *pdev)
 	}
 	cpsw->bus_freq_mhz = clk_get_rate(clk) / 1000000;
 
-	ss_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ss_regs = devm_ioremap_resource(dev, ss_res);
+	ss_regs = devm_platform_get_and_ioremap_resource(pdev, 0, &ss_res);
 	if (IS_ERR(ss_regs)) {
 		ret = PTR_ERR(ss_regs);
 		return ret;