forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/drivers/thermal/zx2967_thermal.c
....@@ -1,11 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ZTE's zx2967 family thermal sensor driver
34 *
45 * Copyright (C) 2017 ZTE Ltd.
56 *
67 * Author: Baoyou Xie <baoyou.xie@linaro.org>
7
- *
8
- * License terms: GNU General Public License (GPL) version 2
98 */
109
1110 #include <linux/clk.h>
....@@ -46,6 +45,7 @@
4645 * @clk_topcrm: topcrm clk structure
4746 * @clk_apb: apb clk structure
4847 * @regs: pointer to base address of the thermal sensor
48
+ * @dev: struct device pointer
4949 */
5050
5151 struct zx2967_thermal_priv {
....@@ -207,8 +207,7 @@
207207 #ifdef CONFIG_PM_SLEEP
208208 static int zx2967_thermal_suspend(struct device *dev)
209209 {
210
- struct platform_device *pdev = to_platform_device(dev);
211
- struct zx2967_thermal_priv *priv = platform_get_drvdata(pdev);
210
+ struct zx2967_thermal_priv *priv = dev_get_drvdata(dev);
212211
213212 if (priv && priv->clk_topcrm)
214213 clk_disable_unprepare(priv->clk_topcrm);
....@@ -221,8 +220,7 @@
221220
222221 static int zx2967_thermal_resume(struct device *dev)
223222 {
224
- struct platform_device *pdev = to_platform_device(dev);
225
- struct zx2967_thermal_priv *priv = platform_get_drvdata(pdev);
223
+ struct zx2967_thermal_priv *priv = dev_get_drvdata(dev);
226224 int error;
227225
228226 error = clk_prepare_enable(priv->clk_topcrm);