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: Sean Young <sean@mess.org>,
	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: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource()
Date: Wed, 1 Sep 2021 09:50:56 +0200	[thread overview]
Message-ID: <da8241fe-8d6e-d9f2-1394-fc758536100b@foss.st.com> (raw)
In-Reply-To: <20210901055455.7179-1-caihuoqing@baidu.com>

Hi Cai

On 9/1/21 7:54 AM, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/media/rc/st_rc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
> index d79d1e3996b2..4e419dbbacd3 100644
> --- a/drivers/media/rc/st_rc.c
> +++ b/drivers/media/rc/st_rc.c
> @@ -231,7 +231,6 @@ static int st_rc_probe(struct platform_device *pdev)
>  	int ret = -EINVAL;
>  	struct rc_dev *rdev;
>  	struct device *dev = &pdev->dev;
> -	struct resource *res;
>  	struct st_rc_device *rc_dev;
>  	struct device_node *np = pdev->dev.of_node;
>  	const char *rx_mode;
> @@ -274,9 +273,7 @@ static int st_rc_probe(struct platform_device *pdev)
>  		goto err;
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> -	rc_dev->base = devm_ioremap_resource(dev, res);
> +	rc_dev->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(rc_dev->base)) {
>  		ret = PTR_ERR(rc_dev->base);
>  		goto err;
> 
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: Sean Young <sean@mess.org>,
	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: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource()
Date: Wed, 1 Sep 2021 09:50:56 +0200	[thread overview]
Message-ID: <da8241fe-8d6e-d9f2-1394-fc758536100b@foss.st.com> (raw)
In-Reply-To: <20210901055455.7179-1-caihuoqing@baidu.com>

Hi Cai

On 9/1/21 7:54 AM, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/media/rc/st_rc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
> index d79d1e3996b2..4e419dbbacd3 100644
> --- a/drivers/media/rc/st_rc.c
> +++ b/drivers/media/rc/st_rc.c
> @@ -231,7 +231,6 @@ static int st_rc_probe(struct platform_device *pdev)
>  	int ret = -EINVAL;
>  	struct rc_dev *rdev;
>  	struct device *dev = &pdev->dev;
> -	struct resource *res;
>  	struct st_rc_device *rc_dev;
>  	struct device_node *np = pdev->dev.of_node;
>  	const char *rx_mode;
> @@ -274,9 +273,7 @@ static int st_rc_probe(struct platform_device *pdev)
>  		goto err;
>  	}
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -
> -	rc_dev->base = devm_ioremap_resource(dev, res);
> +	rc_dev->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(rc_dev->base)) {
>  		ret = PTR_ERR(rc_dev->base);
>  		goto err;
> 
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:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  5:54 [PATCH] media: rc: st_rc: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-01  5:54 ` Cai Huoqing
2021-09-01  7:50 ` Patrice CHOTARD [this message]
2021-09-01  7:50   ` Patrice CHOTARD

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=da8241fe-8d6e-d9f2-1394-fc758536100b@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 \
    --cc=sean@mess.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.