forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/thermal/kirkwood_thermal.c
....@@ -1,17 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Kirkwood thermal sensor driver
34 *
45 * Copyright (C) 2012 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
5
- *
6
- * This software is licensed under the terms of the GNU General Public
7
- * License version 2, as published by the Free Software Foundation, and
8
- * may be copied, distributed, and modified under those terms.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
156 */
167 #include <linux/device.h>
178 #include <linux/err.h>
....@@ -74,6 +65,7 @@
7465 struct thermal_zone_device *thermal = NULL;
7566 struct kirkwood_thermal_priv *priv;
7667 struct resource *res;
68
+ int ret;
7769
7870 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
7971 if (!priv)
....@@ -91,6 +83,12 @@
9183 "Failed to register thermal zone device\n");
9284 return PTR_ERR(thermal);
9385 }
86
+ ret = thermal_zone_device_enable(thermal);
87
+ if (ret) {
88
+ thermal_zone_device_unregister(thermal);
89
+ dev_err(&pdev->dev, "Failed to enable thermal zone device\n");
90
+ return ret;
91
+ }
9492
9593 platform_set_drvdata(pdev, thermal);
9694