Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26d84c27 authored by Wolfram Sang's avatar Wolfram Sang Committed by Zhang Rui
Browse files

thermal: rockchip_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 avatarHeiko Stuebner <heiko@sntech.de>
Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 9d6f76c6
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -1327,8 +1327,7 @@ static int rockchip_thermal_remove(struct platform_device *pdev)

static int __maybe_unused rockchip_thermal_suspend(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev);
	struct rockchip_thermal_data *thermal = dev_get_drvdata(dev);
	int i;

	for (i = 0; i < thermal->chip->chn_num; i++)
@@ -1346,8 +1345,7 @@ static int __maybe_unused rockchip_thermal_suspend(struct device *dev)

static int __maybe_unused rockchip_thermal_resume(struct device *dev)
{
	struct platform_device *pdev = to_platform_device(dev);
	struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev);
	struct rockchip_thermal_data *thermal = dev_get_drvdata(dev);
	int i;
	int error;

@@ -1376,7 +1374,7 @@ static int __maybe_unused rockchip_thermal_resume(struct device *dev)
					      id, thermal->regs,
					      thermal->tshut_temp);
		if (error)
			dev_err(&pdev->dev, "%s: invalid tshut=%d, error=%d\n",
			dev_err(dev, "%s: invalid tshut=%d, error=%d\n",
				__func__, thermal->tshut_temp, error);
	}