aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-12-19 16:17:02 -0500
committerJean Delvare <khali@endymion.delvare>2012-12-19 16:17:02 -0500
commitc4458db3688a603a4cb4b1d01ca10ff0d58bc8eb (patch)
treef87b078e6f4fa3c099c2d67882b34389ac6ab93f /drivers/hwmon
parent1d9bcf6aef0af67901a54ad4c4458e6a2124b769 (diff)
hwmon: (it87) Replace pwm group macro with direct attribute definitions
Fix checkpatch error: ERROR: Macros with multiple statements should be enclosed in a do - while loop Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/it87.c115
1 files changed, 74 insertions, 41 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 28fbafccfe77..59c147b9b976 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -1122,47 +1122,80 @@ static SENSOR_DEVICE_ATTR_2(fan5_input, S_IRUGO, show_fan, NULL, 4, 0);
1122static SENSOR_DEVICE_ATTR_2(fan5_min, S_IRUGO | S_IWUSR, show_fan, set_fan, 1122static SENSOR_DEVICE_ATTR_2(fan5_min, S_IRUGO | S_IWUSR, show_fan, set_fan,
1123 4, 1); 1123 4, 1);
1124 1124
1125#define show_pwm_offset(offset) \ 1125static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR,
1126static SENSOR_DEVICE_ATTR(pwm##offset##_enable, S_IRUGO | S_IWUSR, \ 1126 show_pwm_enable, set_pwm_enable, 0);
1127 show_pwm_enable, set_pwm_enable, offset - 1); \ 1127static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 0);
1128static SENSOR_DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ 1128static DEVICE_ATTR(pwm1_freq, S_IRUGO | S_IWUSR, show_pwm_freq, set_pwm_freq);
1129 show_pwm, set_pwm, offset - 1); \ 1129static SENSOR_DEVICE_ATTR(pwm1_auto_channels_temp, S_IRUGO | S_IWUSR,
1130static DEVICE_ATTR(pwm##offset##_freq, \ 1130 show_pwm_temp_map, set_pwm_temp_map, 0);
1131 (offset == 1 ? S_IRUGO | S_IWUSR : S_IRUGO), \ 1131static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR,
1132 show_pwm_freq, (offset == 1 ? set_pwm_freq : NULL)); \ 1132 show_auto_pwm, set_auto_pwm, 0, 0);
1133static SENSOR_DEVICE_ATTR(pwm##offset##_auto_channels_temp, \ 1133static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_pwm, S_IRUGO | S_IWUSR,
1134 S_IRUGO | S_IWUSR, show_pwm_temp_map, set_pwm_temp_map, \ 1134 show_auto_pwm, set_auto_pwm, 0, 1);
1135 offset - 1); \ 1135static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_pwm, S_IRUGO | S_IWUSR,
1136static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_pwm, \ 1136 show_auto_pwm, set_auto_pwm, 0, 2);
1137 S_IRUGO | S_IWUSR, show_auto_pwm, set_auto_pwm, \ 1137static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_pwm, S_IRUGO,
1138 offset - 1, 0); \ 1138 show_auto_pwm, NULL, 0, 3);
1139static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point2_pwm, \ 1139static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp, S_IRUGO | S_IWUSR,
1140 S_IRUGO | S_IWUSR, show_auto_pwm, set_auto_pwm, \ 1140 show_auto_temp, set_auto_temp, 0, 1);
1141 offset - 1, 1); \ 1141static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp_hyst, S_IRUGO | S_IWUSR,
1142static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point3_pwm, \ 1142 show_auto_temp, set_auto_temp, 0, 0);
1143 S_IRUGO | S_IWUSR, show_auto_pwm, set_auto_pwm, \ 1143static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_temp, S_IRUGO | S_IWUSR,
1144 offset - 1, 2); \ 1144 show_auto_temp, set_auto_temp, 0, 2);
1145static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point4_pwm, \ 1145static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_temp, S_IRUGO | S_IWUSR,
1146 S_IRUGO, show_auto_pwm, NULL, offset - 1, 3); \ 1146 show_auto_temp, set_auto_temp, 0, 3);
1147static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_temp, \ 1147static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_temp, S_IRUGO | S_IWUSR,
1148 S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ 1148 show_auto_temp, set_auto_temp, 0, 4);
1149 offset - 1, 1); \ 1149
1150static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_temp_hyst, \ 1150static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO | S_IWUSR,
1151 S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ 1151 show_pwm_enable, set_pwm_enable, 1);
1152 offset - 1, 0); \ 1152static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 1);
1153static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point2_temp, \ 1153static DEVICE_ATTR(pwm2_freq, S_IRUGO, show_pwm_freq, NULL);
1154 S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ 1154static SENSOR_DEVICE_ATTR(pwm2_auto_channels_temp, S_IRUGO | S_IWUSR,
1155 offset - 1, 2); \ 1155 show_pwm_temp_map, set_pwm_temp_map, 1);
1156static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point3_temp, \ 1156static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR,
1157 S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ 1157 show_auto_pwm, set_auto_pwm, 1, 0);
1158 offset - 1, 3); \ 1158static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR,
1159static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point4_temp, \ 1159 show_auto_pwm, set_auto_pwm, 1, 1);
1160 S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ 1160static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_pwm, S_IRUGO | S_IWUSR,
1161 offset - 1, 4); 1161 show_auto_pwm, set_auto_pwm, 1, 2);
1162 1162static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_pwm, S_IRUGO,
1163show_pwm_offset(1); 1163 show_auto_pwm, NULL, 1, 3);
1164show_pwm_offset(2); 1164static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR,
1165show_pwm_offset(3); 1165 show_auto_temp, set_auto_temp, 1, 1);
1166static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp_hyst, S_IRUGO | S_IWUSR,
1167 show_auto_temp, set_auto_temp, 1, 0);
1168static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR,
1169 show_auto_temp, set_auto_temp, 1, 2);
1170static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR,
1171 show_auto_temp, set_auto_temp, 1, 3);
1172static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_temp, S_IRUGO | S_IWUSR,
1173 show_auto_temp, set_auto_temp, 1, 4);
1174
1175static SENSOR_DEVICE_ATTR(pwm3_enable, S_IRUGO | S_IWUSR,
1176 show_pwm_enable, set_pwm_enable, 2);
1177static SENSOR_DEVICE_ATTR(pwm3, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 2);
1178static DEVICE_ATTR(pwm3_freq, S_IRUGO, show_pwm_freq, NULL);
1179static SENSOR_DEVICE_ATTR(pwm3_auto_channels_temp, S_IRUGO | S_IWUSR,
1180 show_pwm_temp_map, set_pwm_temp_map, 2);
1181static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR,
1182 show_auto_pwm, set_auto_pwm, 2, 0);
1183static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_pwm, S_IRUGO | S_IWUSR,
1184 show_auto_pwm, set_auto_pwm, 2, 1);
1185static SENSOR_DEVICE_ATTR_2(pwm3_auto_point3_pwm, S_IRUGO | S_IWUSR,
1186 show_auto_pwm, set_auto_pwm, 2, 2);
1187static SENSOR_DEVICE_ATTR_2(pwm3_auto_point4_pwm, S_IRUGO,
1188 show_auto_pwm, NULL, 2, 3);
1189static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_temp, S_IRUGO | S_IWUSR,
1190 show_auto_temp, set_auto_temp, 2, 1);
1191static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_temp_hyst, S_IRUGO | S_IWUSR,
1192 show_auto_temp, set_auto_temp, 2, 0);
1193static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_temp, S_IRUGO | S_IWUSR,
1194 show_auto_temp, set_auto_temp, 2, 2);
1195static SENSOR_DEVICE_ATTR_2(pwm3_auto_point3_temp, S_IRUGO | S_IWUSR,
1196 show_auto_temp, set_auto_temp, 2, 3);
1197static SENSOR_DEVICE_ATTR_2(pwm3_auto_point4_temp, S_IRUGO | S_IWUSR,
1198 show_auto_temp, set_auto_temp, 2, 4);
1166 1199
1167/* Alarms */ 1200/* Alarms */
1168static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, 1201static ssize_t show_alarms(struct device *dev, struct device_attribute *attr,