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:
Wolfram Sang 2019-03-19 17:36:35 +01:00 committed by Eduardo Valentin
parent 0f54aa5caf
commit df535485bb

View File

@ -570,8 +570,7 @@ static int stm_thermal_prepare(struct stm_thermal_sensor *sensor)
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)