hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/drivers/hwmon/i5500_temp.c
....@@ -1,17 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * i5500_temp - Driver for Intel 5500/5520/X58 chipset thermal sensor
34 *
45 * Copyright (C) 2012, 2014 Jean Delvare <jdelvare@suse.de>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
156 */
167
178 #include <linux/module.h>
....@@ -58,7 +49,7 @@
5849 return sprintf(buf, "%ld\n", temp);
5950 }
6051
61
-static ssize_t show_thresh(struct device *dev,
52
+static ssize_t thresh_show(struct device *dev,
6253 struct device_attribute *devattr, char *buf)
6354 {
6455 struct pci_dev *pdev = to_pci_dev(dev->parent);
....@@ -72,7 +63,7 @@
7263 return sprintf(buf, "%ld\n", temp);
7364 }
7465
75
-static ssize_t show_alarm(struct device *dev,
66
+static ssize_t alarm_show(struct device *dev,
7667 struct device_attribute *devattr, char *buf)
7768 {
7869 struct pci_dev *pdev = to_pci_dev(dev->parent);
....@@ -84,11 +75,11 @@
8475 }
8576
8677 static DEVICE_ATTR_RO(temp1_input);
87
-static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, show_thresh, NULL, 0xE2);
88
-static SENSOR_DEVICE_ATTR(temp1_max_hyst, S_IRUGO, show_thresh, NULL, 0xEC);
89
-static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, show_thresh, NULL, 0xEE);
90
-static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 0);
91
-static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 1);
78
+static SENSOR_DEVICE_ATTR_RO(temp1_crit, thresh, 0xE2);
79
+static SENSOR_DEVICE_ATTR_RO(temp1_max_hyst, thresh, 0xEC);
80
+static SENSOR_DEVICE_ATTR_RO(temp1_max, thresh, 0xEE);
81
+static SENSOR_DEVICE_ATTR_RO(temp1_crit_alarm, alarm, 0);
82
+static SENSOR_DEVICE_ATTR_RO(temp1_max_alarm, alarm, 1);
9283
9384 static struct attribute *i5500_temp_attrs[] = {
9485 &dev_attr_temp1_input.attr,
....@@ -117,7 +108,7 @@
117108 u32 tstimer;
118109 s8 tsfsc;
119110
120
- err = pci_enable_device(pdev);
111
+ err = pcim_enable_device(pdev);
121112 if (err) {
122113 dev_err(&pdev->dev, "Failed to enable device\n");
123114 return err;