Linux-remoteproc Archive mirror
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Zhang Zekun <zhangzekun11@huawei.com>
Cc: patrice.chotard@foss.st.com, andersson@kernel.org,
	linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH] remoteproc: Use devm_platform_ioremap_resource_byname() helper function
Date: Thu, 5 Sep 2024 10:29:02 -0600	[thread overview]
Message-ID: <ZtncTgIS6EU1A2Kz@p14s> (raw)
In-Reply-To: <20240905120501.131046-1-zhangzekun11@huawei.com>

Hi,

On Thu, Sep 05, 2024 at 08:05:01PM +0800, Zhang Zekun wrote:
> platform_get_resource_byname() and devm_ioremap_resource() can be
> replaced by devm_platform_ioremap_resource_byname(), which can
> simplify the code logic a bit, No functional change here.
> 
> Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
> ---
>  drivers/remoteproc/st_slim_rproc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c
> index d17719384c16..5412beb0a692 100644
> --- a/drivers/remoteproc/st_slim_rproc.c
> +++ b/drivers/remoteproc/st_slim_rproc.c
> @@ -259,16 +259,14 @@ struct st_slim_rproc *st_slim_rproc_alloc(struct platform_device *pdev,
>  		slim_rproc->mem[i].size = resource_size(res);
>  	}
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "slimcore");
> -	slim_rproc->slimcore = devm_ioremap_resource(dev, res);
> +	slim_rproc->slimcore = devm_platform_ioremap_resource_byname(pdev, "slimcore");
>  	if (IS_ERR(slim_rproc->slimcore)) {
>  		dev_err(&pdev->dev, "failed to ioremap slimcore IO\n");
>  		err = PTR_ERR(slim_rproc->slimcore);
>  		goto err;
>  	}
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "peripherals");
> -	slim_rproc->peri = devm_ioremap_resource(dev, res);
> +	slim_rproc->peri = devm_platform_ioremap_resource_byname(pdev, "peripherals");

There are several instances of the above in other drivers of the remoteproc
susbsystem.  Please send another patch with those corrected as well.

Thanks,
Mathieu

>  	if (IS_ERR(slim_rproc->peri)) {
>  		dev_err(&pdev->dev, "failed to ioremap peripherals IO\n");
>  		err = PTR_ERR(slim_rproc->peri);
> -- 
> 2.17.1
> 

      reply	other threads:[~2024-09-05 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 12:05 [PATCH] remoteproc: Use devm_platform_ioremap_resource_byname() helper function Zhang Zekun
2024-09-05 16:29 ` Mathieu Poirier [this message]

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=ZtncTgIS6EU1A2Kz@p14s \
    --to=mathieu.poirier@linaro.org \
    --cc=andersson@kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=zhangzekun11@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 read-only IMAP folder(s) and NNTP newsgroup(s).