thermal: spear_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>
This commit is contained in:
parent
26d84c276c
commit
3fc62efe09
|
@ -56,8 +56,7 @@ static struct thermal_zone_device_ops ops = {
|
||||||
|
|
||||||
static int __maybe_unused spear_thermal_suspend(struct device *dev)
|
static int __maybe_unused spear_thermal_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev);
|
||||||
struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
|
|
||||||
struct spear_thermal_dev *stdev = spear_thermal->devdata;
|
struct spear_thermal_dev *stdev = spear_thermal->devdata;
|
||||||
unsigned int actual_mask = 0;
|
unsigned int actual_mask = 0;
|
||||||
|
|
||||||
|
@ -73,15 +72,14 @@ static int __maybe_unused spear_thermal_suspend(struct device *dev)
|
||||||
|
|
||||||
static int __maybe_unused spear_thermal_resume(struct device *dev)
|
static int __maybe_unused spear_thermal_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct thermal_zone_device *spear_thermal = dev_get_drvdata(dev);
|
||||||
struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
|
|
||||||
struct spear_thermal_dev *stdev = spear_thermal->devdata;
|
struct spear_thermal_dev *stdev = spear_thermal->devdata;
|
||||||
unsigned int actual_mask = 0;
|
unsigned int actual_mask = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
ret = clk_enable(stdev->clk);
|
ret = clk_enable(stdev->clk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "Can't enable clock\n");
|
dev_err(dev, "Can't enable clock\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue