diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-10-21 22:00:51 +0200 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2018-11-30 16:46:57 +0800 |
commit | 445ae758ceaf394636ad7ab9872f52cdc24165a6 (patch) | |
tree | ce8b8bd989467a8801f07251d0418d6e431fd5f5 /drivers/thermal/st | |
parent | 3fc62efe09975c160c413a4b7d10c029e0f04470 (diff) |
thermal: st: st_thermal: simplify getting .driver_data
We should get 'driver_data' 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>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/st')
-rw-r--r-- | drivers/thermal/st/st_thermal.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c index be637e6b01d2..b2bbdf6eb02b 100644 --- a/drivers/thermal/st/st_thermal.c +++ b/drivers/thermal/st/st_thermal.c @@ -277,8 +277,7 @@ EXPORT_SYMBOL_GPL(st_thermal_unregister); #ifdef CONFIG_PM_SLEEP static int st_thermal_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct st_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct st_thermal_sensor *sensor = dev_get_drvdata(dev); return st_thermal_sensor_off(sensor); } @@ -286,8 +285,7 @@ static int st_thermal_suspend(struct device *dev) static int st_thermal_resume(struct device *dev) { int ret; - struct platform_device *pdev = to_platform_device(dev); - struct st_thermal_sensor *sensor = platform_get_drvdata(pdev); + struct st_thermal_sensor *sensor = dev_get_drvdata(dev); ret = st_thermal_sensor_on(sensor); if (ret) |