All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Anson Huang <Anson.Huang@nxp.com>
Cc: shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Linux-imx@nxp.com
Subject: Re: [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code
Date: Tue, 24 Sep 2019 13:02:48 +0200	[thread overview]
Message-ID: <20190924110248.GF14924@ulmo> (raw)
In-Reply-To: <1569318169-12327-1-git-send-email-Anson.Huang@nxp.com>

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

On Tue, Sep 24, 2019 at 05:42:48PM +0800, Anson Huang wrote:
> Use the new helper devm_platform_ioremap_resource() which wraps the
> platform_get_resource() and devm_ioremap_resource() together, to
> simplify the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> 	- This is a resend version of patch: https://patchwork.kernel.org/patch/11048365/
> ---
>  drivers/pwm/pwm-mxs.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

When you do resend patches, please make sure to include an Reviewed-by
or Acked-by tags that you get.

In this case that's not necessary since I had already applied the other
patch.

Thierry

> 
> diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
> index 04c0f6b..b14376b 100644
> --- a/drivers/pwm/pwm-mxs.c
> +++ b/drivers/pwm/pwm-mxs.c
> @@ -126,15 +126,13 @@ static int mxs_pwm_probe(struct platform_device *pdev)
>  {
>  	struct device_node *np = pdev->dev.of_node;
>  	struct mxs_pwm_chip *mxs;
> -	struct resource *res;
>  	int ret;
>  
>  	mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL);
>  	if (!mxs)
>  		return -ENOMEM;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	mxs->base = devm_ioremap_resource(&pdev->dev, res);
> +	mxs->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mxs->base))
>  		return PTR_ERR(mxs->base);
>  
> -- 
> 2.7.4
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Thierry Reding <thierry.reding@gmail.com>
To: Anson Huang <Anson.Huang@nxp.com>
Cc: linux-pwm@vger.kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, linux-kernel@vger.kernel.org,
	Linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code
Date: Tue, 24 Sep 2019 13:02:48 +0200	[thread overview]
Message-ID: <20190924110248.GF14924@ulmo> (raw)
In-Reply-To: <1569318169-12327-1-git-send-email-Anson.Huang@nxp.com>


[-- Attachment #1.1: Type: text/plain, Size: 1405 bytes --]

On Tue, Sep 24, 2019 at 05:42:48PM +0800, Anson Huang wrote:
> Use the new helper devm_platform_ioremap_resource() which wraps the
> platform_get_resource() and devm_ioremap_resource() together, to
> simplify the code.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> 	- This is a resend version of patch: https://patchwork.kernel.org/patch/11048365/
> ---
>  drivers/pwm/pwm-mxs.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

When you do resend patches, please make sure to include an Reviewed-by
or Acked-by tags that you get.

In this case that's not necessary since I had already applied the other
patch.

Thierry

> 
> diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c
> index 04c0f6b..b14376b 100644
> --- a/drivers/pwm/pwm-mxs.c
> +++ b/drivers/pwm/pwm-mxs.c
> @@ -126,15 +126,13 @@ static int mxs_pwm_probe(struct platform_device *pdev)
>  {
>  	struct device_node *np = pdev->dev.of_node;
>  	struct mxs_pwm_chip *mxs;
> -	struct resource *res;
>  	int ret;
>  
>  	mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL);
>  	if (!mxs)
>  		return -ENOMEM;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	mxs->base = devm_ioremap_resource(&pdev->dev, res);
> +	mxs->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(mxs->base))
>  		return PTR_ERR(mxs->base);
>  
> -- 
> 2.7.4
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

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

  parent reply	other threads:[~2019-09-24 11:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-24  9:42 [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code Anson Huang
2019-09-24  9:42 ` Anson Huang
2019-09-24  9:42 ` [PATCH 2/2] pwm: pwm-mxs: Use 'dev' instead of dereferencing it repeatedly Anson Huang
2019-09-24  9:42   ` Anson Huang
2019-09-24 10:53   ` Thierry Reding
2019-09-24 10:53     ` Thierry Reding
2019-09-24 11:02 ` Thierry Reding [this message]
2019-09-24 11:02   ` [PATCH 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code Thierry Reding

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=20190924110248.GF14924@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=Anson.Huang@nxp.com \
    --cc=Linux-imx@nxp.com \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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.