diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-12-19 16:17:02 -0500 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2012-12-19 16:17:02 -0500 |
commit | c4458db3688a603a4cb4b1d01ca10ff0d58bc8eb (patch) | |
tree | f87b078e6f4fa3c099c2d67882b34389ac6ab93f /drivers/hwmon | |
parent | 1d9bcf6aef0af67901a54ad4c4458e6a2124b769 (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.c | 115 |
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); | |||
1122 | static SENSOR_DEVICE_ATTR_2(fan5_min, S_IRUGO | S_IWUSR, show_fan, set_fan, | 1122 | static 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) \ | 1125 | static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, |
1126 | static 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); \ | 1127 | static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 0); |
1128 | static SENSOR_DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ | 1128 | static DEVICE_ATTR(pwm1_freq, S_IRUGO | S_IWUSR, show_pwm_freq, set_pwm_freq); |
1129 | show_pwm, set_pwm, offset - 1); \ | 1129 | static SENSOR_DEVICE_ATTR(pwm1_auto_channels_temp, S_IRUGO | S_IWUSR, |
1130 | static DEVICE_ATTR(pwm##offset##_freq, \ | 1130 | show_pwm_temp_map, set_pwm_temp_map, 0); |
1131 | (offset == 1 ? S_IRUGO | S_IWUSR : S_IRUGO), \ | 1131 | static 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); |
1133 | static SENSOR_DEVICE_ATTR(pwm##offset##_auto_channels_temp, \ | 1133 | static 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); \ | 1135 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_pwm, S_IRUGO | S_IWUSR, |
1136 | static 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, \ | 1137 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_pwm, S_IRUGO, |
1138 | offset - 1, 0); \ | 1138 | show_auto_pwm, NULL, 0, 3); |
1139 | static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point2_pwm, \ | 1139 | static 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); \ | 1141 | static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp_hyst, S_IRUGO | S_IWUSR, |
1142 | static 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, \ | 1143 | static 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); |
1145 | static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point4_pwm, \ | 1145 | static 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); |
1147 | static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_temp, \ | 1147 | static 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 | |
1150 | static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_temp_hyst, \ | 1150 | static 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); \ | 1152 | static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 1); |
1153 | static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point2_temp, \ | 1153 | static DEVICE_ATTR(pwm2_freq, S_IRUGO, show_pwm_freq, NULL); |
1154 | S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ | 1154 | static 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); |
1156 | static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point3_temp, \ | 1156 | static 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); \ | 1158 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR, |
1159 | static 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, \ | 1160 | static 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 | 1162 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_pwm, S_IRUGO, | |
1163 | show_pwm_offset(1); | 1163 | show_auto_pwm, NULL, 1, 3); |
1164 | show_pwm_offset(2); | 1164 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR, |
1165 | show_pwm_offset(3); | 1165 | show_auto_temp, set_auto_temp, 1, 1); |
1166 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp_hyst, S_IRUGO | S_IWUSR, | ||
1167 | show_auto_temp, set_auto_temp, 1, 0); | ||
1168 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR, | ||
1169 | show_auto_temp, set_auto_temp, 1, 2); | ||
1170 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR, | ||
1171 | show_auto_temp, set_auto_temp, 1, 3); | ||
1172 | static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_temp, S_IRUGO | S_IWUSR, | ||
1173 | show_auto_temp, set_auto_temp, 1, 4); | ||
1174 | |||
1175 | static SENSOR_DEVICE_ATTR(pwm3_enable, S_IRUGO | S_IWUSR, | ||
1176 | show_pwm_enable, set_pwm_enable, 2); | ||
1177 | static SENSOR_DEVICE_ATTR(pwm3, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 2); | ||
1178 | static DEVICE_ATTR(pwm3_freq, S_IRUGO, show_pwm_freq, NULL); | ||
1179 | static SENSOR_DEVICE_ATTR(pwm3_auto_channels_temp, S_IRUGO | S_IWUSR, | ||
1180 | show_pwm_temp_map, set_pwm_temp_map, 2); | ||
1181 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR, | ||
1182 | show_auto_pwm, set_auto_pwm, 2, 0); | ||
1183 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_pwm, S_IRUGO | S_IWUSR, | ||
1184 | show_auto_pwm, set_auto_pwm, 2, 1); | ||
1185 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point3_pwm, S_IRUGO | S_IWUSR, | ||
1186 | show_auto_pwm, set_auto_pwm, 2, 2); | ||
1187 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point4_pwm, S_IRUGO, | ||
1188 | show_auto_pwm, NULL, 2, 3); | ||
1189 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_temp, S_IRUGO | S_IWUSR, | ||
1190 | show_auto_temp, set_auto_temp, 2, 1); | ||
1191 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_temp_hyst, S_IRUGO | S_IWUSR, | ||
1192 | show_auto_temp, set_auto_temp, 2, 0); | ||
1193 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_temp, S_IRUGO | S_IWUSR, | ||
1194 | show_auto_temp, set_auto_temp, 2, 2); | ||
1195 | static SENSOR_DEVICE_ATTR_2(pwm3_auto_point3_temp, S_IRUGO | S_IWUSR, | ||
1196 | show_auto_temp, set_auto_temp, 2, 3); | ||
1197 | static 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 */ |
1168 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, | 1201 | static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, |