From: Thierry Reding Date: Mon, 21 Aug 2017 06:42:56 +0000 (+0200) Subject: pwm: tiehrpwm: Set driver data before runtime PM enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d870c80e1d1523e449e98d230ea048257123b7cb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git pwm: tiehrpwm: Set driver data before runtime PM enable Runtime PM callbacks can be run right after runtime PM is enabled, so make sure to set the driver data before that. This is unlikely to ever happen with the current driver, but it doesn't hurt to follow best practices anyway. Signed-off-by: Thierry Reding --- diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c index 6f87a0d5828d..4c22cb395040 100644 --- a/drivers/pwm/pwm-tiehrpwm.c +++ b/drivers/pwm/pwm-tiehrpwm.c @@ -498,9 +498,9 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev) goto err_clk_unprepare; } + platform_set_drvdata(pdev, pc); pm_runtime_enable(&pdev->dev); - platform_set_drvdata(pdev, pc); return 0; err_clk_unprepare: