Re: [PATCH] pwm: rcar: simplify getting .drvdata

2018-04-09 Thread Simon Horman
On Thu, Apr 05, 2018 at 07:25:51PM +0200, 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 
> ---
> 
> Only build tested. Fixed numerous times in other drivers, however...

Reviewed-by: Simon Horman 


Re: [PATCH] pwm: rcar: simplify getting .drvdata

2018-04-09 Thread Geert Uytterhoeven
On Thu, Apr 5, 2018 at 7:25 PM, 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 

Reviewed-by: Geert Uytterhoeven 

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


RE: [PATCH] pwm: rcar: simplify getting .drvdata

2018-04-06 Thread Yoshihiro Shimoda
Hi Wolfram-san,

> From: Wolfram Sang, Sent: Friday, April 6, 2018 2:26 AM
> 
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
> 
> Signed-off-by: Wolfram Sang 
> ---
> 
> Only build tested. Fixed numerous times in other drivers, however...

Thank you for the patch!

Acked-by: Yoshihiro Shimoda 

Best regards,
Yoshihiro Shimoda

>  drivers/pwm/pwm-rcar.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> 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 = _pwm->chip;
> 
>   return >pwms[0];
> --
> 2.11.0