Commit 445ae758 authored by Wolfram Sang's avatar Wolfram Sang Committed by Zhang Rui

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 3fc62efe
......@@ -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)
......
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