hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/platform/x86/intel_mid_thermal.c
....@@ -1,39 +1,23 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
2
- * intel_mid_thermal.c - Intel MID platform thermal driver
3
+ * Intel MID platform thermal driver
34 *
45 * Copyright (C) 2011 Intel Corporation
56 *
6
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; version 2 of the License.
11
- *
12
- * This program is distributed in the hope that it will be useful, but
13
- * WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- * General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along
18
- * with this program; if not, write to the Free Software Foundation, Inc.,
19
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20
- *
21
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
227 * Author: Durgadoss R <durgadoss.r@intel.com>
238 */
249
2510 #define pr_fmt(fmt) "intel_mid_thermal: " fmt
2611
27
-#include <linux/module.h>
28
-#include <linux/init.h>
29
-#include <linux/err.h>
30
-#include <linux/param.h>
3112 #include <linux/device.h>
32
-#include <linux/platform_device.h>
33
-#include <linux/slab.h>
34
-#include <linux/pm.h>
35
-#include <linux/thermal.h>
13
+#include <linux/err.h>
3614 #include <linux/mfd/intel_msic.h>
15
+#include <linux/module.h>
16
+#include <linux/param.h>
17
+#include <linux/platform_device.h>
18
+#include <linux/pm.h>
19
+#include <linux/slab.h>
20
+#include <linux/thermal.h>
3721
3822 /* Number of thermal sensors */
3923 #define MSIC_THERMAL_SENSORS 4
....@@ -509,6 +493,12 @@
509493 ret = PTR_ERR(pinfo->tzd[i]);
510494 goto err;
511495 }
496
+ ret = thermal_zone_device_enable(pinfo->tzd[i]);
497
+ if (ret) {
498
+ kfree(td_info);
499
+ thermal_zone_device_unregister(pinfo->tzd[i]);
500
+ goto err;
501
+ }
512502 }
513503
514504 pinfo->pdev = pdev;
....@@ -567,4 +557,4 @@
567557
568558 MODULE_AUTHOR("Durgadoss R <durgadoss.r@intel.com>");
569559 MODULE_DESCRIPTION("Intel Medfield Platform Thermal Driver");
570
-MODULE_LICENSE("GPL");
560
+MODULE_LICENSE("GPL v2");