浏览代码

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 <thierry.reding@gmail.com>
Thierry Reding 8 年之前
父节点
当前提交
d870c80e1d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/pwm/pwm-tiehrpwm.c

+ 1 - 1
drivers/pwm/pwm-tiehrpwm.c

@@ -498,9 +498,9 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev)
 		goto err_clk_unprepare;
 		goto err_clk_unprepare;
 	}
 	}
 
 
+	platform_set_drvdata(pdev, pc);
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 
 
-	platform_set_drvdata(pdev, pc);
 	return 0;
 	return 0;
 
 
 err_clk_unprepare:
 err_clk_unprepare: