mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 14:41:39 +00:00
thermal: stm32: 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: Simon Horman <horms+renesas@verge.net.au> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
parent
0f54aa5caf
commit
df535485bb
@ -570,8 +570,7 @@ thermal_unprepare:
|
||||
static int stm_thermal_suspend(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev);
|
||||
struct stm_thermal_sensor *sensor = dev_get_drvdata(dev);
|
||||
|
||||
ret = stm_thermal_sensor_off(sensor);
|
||||
if (ret)
|
||||
@ -585,8 +584,7 @@ static int stm_thermal_suspend(struct device *dev)
|
||||
static int stm_thermal_resume(struct device *dev)
|
||||
{
|
||||
int ret;
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev);
|
||||
struct stm_thermal_sensor *sensor = dev_get_drvdata(dev);
|
||||
|
||||
ret = stm_thermal_prepare(sensor);
|
||||
if (ret)
|
||||
|
Loading…
Reference in New Issue
Block a user