hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/hwmon/nsa320-hwmon.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * drivers/hwmon/nsa320-hwmon.c
34 *
....@@ -7,15 +8,6 @@
78 * Copyright (C) 2016 Adam Baker <linux@baker-net.org.uk>
89 * based on a board file driver
910 * Copyright (C) 2012 Peter Schildmann <linux@schildmann.info>
10
- *
11
- * This program is free software; you can redistribute it and/or modify it
12
- * under the terms of the GNU General Public License v2 as published by the
13
- * Free Software Foundation.
14
- *
15
- * This program is distributed in the hope that it will be useful, but WITHOUT
16
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18
- * more details.
1911 */
2012
2113 #include <linux/bitops.h>
....@@ -114,8 +106,8 @@
114106 return mcu_data;
115107 }
116108
117
-static ssize_t show_label(struct device *dev,
118
- struct device_attribute *attr, char *buf)
109
+static ssize_t label_show(struct device *dev, struct device_attribute *attr,
110
+ char *buf)
119111 {
120112 int channel = to_sensor_dev_attr(attr)->index;
121113
....@@ -144,9 +136,9 @@
144136 return sprintf(buf, "%d\n", ((mcu_data & 0xff0000) >> 16) * 100);
145137 }
146138
147
-static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, show_label, NULL, NSA320_TEMP);
139
+static SENSOR_DEVICE_ATTR_RO(temp1_label, label, NSA320_TEMP);
148140 static DEVICE_ATTR_RO(temp1_input);
149
-static SENSOR_DEVICE_ATTR(fan1_label, S_IRUGO, show_label, NULL, NSA320_FAN);
141
+static SENSOR_DEVICE_ATTR_RO(fan1_label, label, NSA320_FAN);
150142 static DEVICE_ATTR_RO(fan1_input);
151143
152144 static struct attribute *nsa320_attrs[] = {