All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Cai Huoqing <caihuoqing@baidu.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: sti/c8sectpfe: Make use of the helper function devm_platform_ioremap_resource_byname()
Date: Wed, 1 Sep 2021 09:53:31 +0200	[thread overview]
Message-ID: <73002944-80b0-ba24-f490-0aaefd4ea08b@foss.st.com> (raw)
In-Reply-To: <20210901055631.7829-1-caihuoqing@baidu.com>

Hi Cai

On 9/1/21 7:56 AM, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
> index 02dc78bd7fab..9f05984f711a 100644
> --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
> +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
> @@ -665,7 +665,6 @@ static int c8sectpfe_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct device_node *child, *np = dev->of_node;
>  	struct c8sectpfei *fei;
> -	struct resource *res;
>  	int ret, index = 0;
>  	struct channel_info *tsin;
>  
> @@ -676,14 +675,11 @@ static int c8sectpfe_probe(struct platform_device *pdev)
>  
>  	fei->dev = dev;
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "c8sectpfe");
> -	fei->io = devm_ioremap_resource(dev, res);
> +	fei->io = devm_platform_ioremap_resource_byname(pdev, "c8sectpfe");
>  	if (IS_ERR(fei->io))
>  		return PTR_ERR(fei->io);
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> -					"c8sectpfe-ram");
> -	fei->sram = devm_ioremap_resource(dev, res);
> +	fei->sram = devm_platform_ioremap_resource_byname(pdev, "c8sectpfe-ram");
>  	if (IS_ERR(fei->sram))
>  		return PTR_ERR(fei->sram);
>  
> 
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

WARNING: multiple messages have this Message-ID (diff)
From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Cai Huoqing <caihuoqing@baidu.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: sti/c8sectpfe: Make use of the helper function devm_platform_ioremap_resource_byname()
Date: Wed, 1 Sep 2021 09:53:31 +0200	[thread overview]
Message-ID: <73002944-80b0-ba24-f490-0aaefd4ea08b@foss.st.com> (raw)
In-Reply-To: <20210901055631.7829-1-caihuoqing@baidu.com>

Hi Cai

On 9/1/21 7:56 AM, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
> index 02dc78bd7fab..9f05984f711a 100644
> --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
> +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
> @@ -665,7 +665,6 @@ static int c8sectpfe_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct device_node *child, *np = dev->of_node;
>  	struct c8sectpfei *fei;
> -	struct resource *res;
>  	int ret, index = 0;
>  	struct channel_info *tsin;
>  
> @@ -676,14 +675,11 @@ static int c8sectpfe_probe(struct platform_device *pdev)
>  
>  	fei->dev = dev;
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "c8sectpfe");
> -	fei->io = devm_ioremap_resource(dev, res);
> +	fei->io = devm_platform_ioremap_resource_byname(pdev, "c8sectpfe");
>  	if (IS_ERR(fei->io))
>  		return PTR_ERR(fei->io);
>  
> -	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> -					"c8sectpfe-ram");
> -	fei->sram = devm_ioremap_resource(dev, res);
> +	fei->sram = devm_platform_ioremap_resource_byname(pdev, "c8sectpfe-ram");
>  	if (IS_ERR(fei->sram))
>  		return PTR_ERR(fei->sram);
>  
> 
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-09-01  7:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  5:56 [PATCH] media: sti/c8sectpfe: Make use of the helper function devm_platform_ioremap_resource_byname() Cai Huoqing
2021-09-01  5:56 ` Cai Huoqing
2021-09-01  7:53 ` Patrice CHOTARD [this message]
2021-09-01  7:53   ` Patrice CHOTARD
2021-09-01  8:20 ` Hans Verkuil
2021-09-01  8:20   ` Hans Verkuil
2021-09-01  8:41   ` Cai Huoqing
2021-09-01  8:41     ` Cai Huoqing

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=73002944-80b0-ba24-f490-0aaefd4ea08b@foss.st.com \
    --to=patrice.chotard@foss.st.com \
    --cc=caihuoqing@baidu.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.