Message ID | 20210609140152.3198309-1-yangyingliang@huawei.com |
---|---|
State | New |
Headers | show |
Series | [net-next] net: ethernet: ti: cpsw: Use devm_platform_get_and_ioremap_resource() | expand |
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 --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;
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(-)