Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wolfram Sang and committed by
Eduardo Valentin
df535485 0f54aa5c

+2 -4
+2 -4
drivers/thermal/st/stm_thermal.c
··· 570 570 static int stm_thermal_suspend(struct device *dev) 571 571 { 572 572 int ret; 573 - struct platform_device *pdev = to_platform_device(dev); 574 - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); 573 + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev); 575 574 576 575 ret = stm_thermal_sensor_off(sensor); 577 576 if (ret) ··· 584 585 static int stm_thermal_resume(struct device *dev) 585 586 { 586 587 int ret; 587 - struct platform_device *pdev = to_platform_device(dev); 588 - struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev); 588 + struct stm_thermal_sensor *sensor = dev_get_drvdata(dev); 589 589 590 590 ret = stm_thermal_prepare(sensor); 591 591 if (ret)