[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <457bcc88-00a1-61fd-7a1d-1c8dfaaf56d6@ti.com>
Date: Wed, 9 Jun 2021 20:18:11 +0300
From: Grygorii Strashko <grygorii.strashko@...com>
To: Yang Yingliang <yangyingliang@...wei.com>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>
CC: <davem@...emloft.net>, <kuba@...nel.org>
Subject: Re: [PATCH net-next] net: ethernet: ti: cpsw: Use
devm_platform_get_and_ioremap_resource()
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@...wei.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@...com>
--
Best regards,
grygorii
Powered by blists - more mailing lists