public inbox for linux-pwm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-kernel@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 43/61] pwm: simplify getting .drvdata
Date: Fri, 20 Apr 2018 10:17:47 +0200	[thread overview]
Message-ID: <e7d16777-6a31-2657-0ce9-463f6d908ee9@microchip.com> (raw)
In-Reply-To: <20180419140641.27926-44-wsa+renesas@sang-engineering.com>

On 19/04/2018 at 16:06, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

> ---
> 
> Build tested only. buildbot is happy. Please apply individually.
> 
>   drivers/pwm/pwm-atmel-tcb.c | 6 ++----
>   drivers/pwm/pwm-rcar.c      | 3 +--
>   2 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c
> index 4fb1be246c44..0d0f8376bc35 100644
> --- a/drivers/pwm/pwm-atmel-tcb.c
> +++ b/drivers/pwm/pwm-atmel-tcb.c
> @@ -460,8 +460,7 @@ MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
>   #ifdef CONFIG_PM_SLEEP
>   static int atmel_tcb_pwm_suspend(struct device *dev)
>   {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);
> +	struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev);
>   	void __iomem *base = tcbpwm->tc->regs;
>   	int i;
>   
> @@ -478,8 +477,7 @@ static int atmel_tcb_pwm_suspend(struct device *dev)
>   
>   static int atmel_tcb_pwm_resume(struct device *dev)
>   {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);
> +	struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev);
>   	void __iomem *base = tcbpwm->tc->regs;
>   	int i;
>   
> diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c
> index 91d11f2e2fef..748f614d5375 100644
> --- a/drivers/pwm/pwm-rcar.c
> +++ b/drivers/pwm/pwm-rcar.c
> @@ -261,8 +261,7 @@ MODULE_DEVICE_TABLE(of, rcar_pwm_of_table);
>   #ifdef CONFIG_PM_SLEEP
>   static struct pwm_device *rcar_pwm_dev_to_pwm_dev(struct device *dev)
>   {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct rcar_pwm_chip *rcar_pwm = platform_get_drvdata(pdev);
> +	struct rcar_pwm_chip *rcar_pwm = dev_get_drvdata(dev);
>   	struct pwm_chip *chip = &rcar_pwm->chip;
>   
>   	return &chip->pwms[0];
> 


-- 
Nicolas Ferre

  reply	other threads:[~2018-04-20  8:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 14:05 [PATCH 00/61] tree-wide: simplify getting .drvdata Wolfram Sang
2018-04-19 14:06 ` [PATCH 43/61] pwm: " Wolfram Sang
2018-04-20  8:17   ` Nicolas Ferre [this message]
2018-04-30  9:28   ` 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=e7d16777-6a31-2657-0ce9-463f6d908ee9@microchip.com \
    --to=nicolas.ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=wsa+renesas@sang-engineering.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