linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Yang Yingliang <yangyingliang@huawei.com>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <kuba@kernel.org>
Subject: Re: [PATCH net-next] net: ethernet: ti: cpsw: Use devm_platform_get_and_ioremap_resource()
Date: Wed, 9 Jun 2021 20:18:11 +0300	[thread overview]
Message-ID: <457bcc88-00a1-61fd-7a1d-1c8dfaaf56d6@ti.com> (raw)
In-Reply-To: <20210609140152.3198309-1-yangyingliang@huawei.com>



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>

-- 
Best regards,
grygorii

  reply	other threads:[~2021-06-09 17:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 14:01 [PATCH net-next] net: ethernet: ti: cpsw: Use devm_platform_get_and_ioremap_resource() Yang Yingliang
2021-06-09 17:18 ` Grygorii Strashko [this message]
2021-06-10 20:40 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=457bcc88-00a1-61fd-7a1d-1c8dfaaf56d6@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).