hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/hwmon/vexpress-hwmon.c
....@@ -1,12 +1,5 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
2
- * This program is free software; you can redistribute it and/or modify
3
- * it under the terms of the GNU General Public License version 2 as
4
- * published by the Free Software Foundation.
5
- *
6
- * This program is distributed in the hope that it will be useful,
7
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
8
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
- * GNU General Public License for more details.
103 *
114 * Copyright (C) 2012 ARM Limited
125 */
....@@ -92,9 +85,8 @@
9285 };
9386
9487 #if !defined(CONFIG_REGULATOR_VEXPRESS)
95
-static DEVICE_ATTR(in1_label, S_IRUGO, vexpress_hwmon_label_show, NULL);
96
-static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, vexpress_hwmon_u32_show,
97
- NULL, 1000);
88
+static DEVICE_ATTR(in1_label, 0444, vexpress_hwmon_label_show, NULL);
89
+static SENSOR_DEVICE_ATTR_RO(in1_input, vexpress_hwmon_u32, 1000);
9890 static struct attribute *vexpress_hwmon_attrs_volt[] = {
9991 &dev_attr_in1_label.attr,
10092 &sensor_dev_attr_in1_input.dev_attr.attr,
....@@ -113,9 +105,8 @@
113105 };
114106 #endif
115107
116
-static DEVICE_ATTR(curr1_label, S_IRUGO, vexpress_hwmon_label_show, NULL);
117
-static SENSOR_DEVICE_ATTR(curr1_input, S_IRUGO, vexpress_hwmon_u32_show,
118
- NULL, 1000);
108
+static DEVICE_ATTR(curr1_label, 0444, vexpress_hwmon_label_show, NULL);
109
+static SENSOR_DEVICE_ATTR_RO(curr1_input, vexpress_hwmon_u32, 1000);
119110 static struct attribute *vexpress_hwmon_attrs_amp[] = {
120111 &dev_attr_curr1_label.attr,
121112 &sensor_dev_attr_curr1_input.dev_attr.attr,
....@@ -133,9 +124,8 @@
133124 },
134125 };
135126
136
-static DEVICE_ATTR(temp1_label, S_IRUGO, vexpress_hwmon_label_show, NULL);
137
-static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, vexpress_hwmon_u32_show,
138
- NULL, 1000);
127
+static DEVICE_ATTR(temp1_label, 0444, vexpress_hwmon_label_show, NULL);
128
+static SENSOR_DEVICE_ATTR_RO(temp1_input, vexpress_hwmon_u32, 1000);
139129 static struct attribute *vexpress_hwmon_attrs_temp[] = {
140130 &dev_attr_temp1_label.attr,
141131 &sensor_dev_attr_temp1_input.dev_attr.attr,
....@@ -153,9 +143,8 @@
153143 },
154144 };
155145
156
-static DEVICE_ATTR(power1_label, S_IRUGO, vexpress_hwmon_label_show, NULL);
157
-static SENSOR_DEVICE_ATTR(power1_input, S_IRUGO, vexpress_hwmon_u32_show,
158
- NULL, 1);
146
+static DEVICE_ATTR(power1_label, 0444, vexpress_hwmon_label_show, NULL);
147
+static SENSOR_DEVICE_ATTR_RO(power1_input, vexpress_hwmon_u32, 1);
159148 static struct attribute *vexpress_hwmon_attrs_power[] = {
160149 &dev_attr_power1_label.attr,
161150 &sensor_dev_attr_power1_input.dev_attr.attr,
....@@ -173,9 +162,8 @@
173162 },
174163 };
175164
176
-static DEVICE_ATTR(energy1_label, S_IRUGO, vexpress_hwmon_label_show, NULL);
177
-static SENSOR_DEVICE_ATTR(energy1_input, S_IRUGO, vexpress_hwmon_u64_show,
178
- NULL, 1);
165
+static DEVICE_ATTR(energy1_label, 0444, vexpress_hwmon_label_show, NULL);
166
+static SENSOR_DEVICE_ATTR_RO(energy1_input, vexpress_hwmon_u64, 1);
179167 static struct attribute *vexpress_hwmon_attrs_energy[] = {
180168 &dev_attr_energy1_label.attr,
181169 &sensor_dev_attr_energy1_input.dev_attr.attr,