Commit 692099cd authored by Wolfram Sang's avatar Wolfram Sang Committed by Thierry Reding

pwm: simplify getting .drvdata

We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 735596ca
...@@ -460,8 +460,7 @@ MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids); ...@@ -460,8 +460,7 @@ MODULE_DEVICE_TABLE(of, atmel_tcb_pwm_dt_ids);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int atmel_tcb_pwm_suspend(struct device *dev) static int atmel_tcb_pwm_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct atmel_tcb_pwm_chip *tcbpwm = dev_get_drvdata(dev);
struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);
void __iomem *base = tcbpwm->tc->regs; void __iomem *base = tcbpwm->tc->regs;
int i; int i;
...@@ -478,8 +477,7 @@ static int atmel_tcb_pwm_suspend(struct device *dev) ...@@ -478,8 +477,7 @@ static int atmel_tcb_pwm_suspend(struct device *dev)
static int atmel_tcb_pwm_resume(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 = dev_get_drvdata(dev);
struct atmel_tcb_pwm_chip *tcbpwm = platform_get_drvdata(pdev);
void __iomem *base = tcbpwm->tc->regs; void __iomem *base = tcbpwm->tc->regs;
int i; int i;
......
...@@ -261,8 +261,7 @@ MODULE_DEVICE_TABLE(of, rcar_pwm_of_table); ...@@ -261,8 +261,7 @@ MODULE_DEVICE_TABLE(of, rcar_pwm_of_table);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static struct pwm_device *rcar_pwm_dev_to_pwm_dev(struct device *dev) 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 = dev_get_drvdata(dev);
struct rcar_pwm_chip *rcar_pwm = platform_get_drvdata(pdev);
struct pwm_chip *chip = &rcar_pwm->chip; struct pwm_chip *chip = &rcar_pwm->chip;
return &chip->pwms[0]; return &chip->pwms[0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment