summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-atmel-tcb.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-04-19 16:06:13 +0200
committerThierry Reding <thierry.reding@gmail.com>2018-04-30 10:40:57 +0200
commit692099cdcf275df272936b31c8409f2a5a1f7239 (patch)
tree4565f4ea933abf5a742911d2dfd8f98ec9ef0ce1 /drivers/pwm/pwm-atmel-tcb.c
parent735596ca8a1cd3de87f0ff05213bb2ee0495ccbd (diff)
downloadlinux-692099cdcf275df272936b31c8409f2a5a1f7239.tar.bz2
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: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-atmel-tcb.c')
-rw-r--r--drivers/pwm/pwm-atmel-tcb.c6
1 files changed, 2 insertions, 4 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;