Commit c4458db3 authored by Guenter Roeck's avatar Guenter Roeck Committed by Jean Delvare

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: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 1d9bcf6a
...@@ -1122,47 +1122,80 @@ static SENSOR_DEVICE_ATTR_2(fan5_input, S_IRUGO, show_fan, NULL, 4, 0); ...@@ -1122,47 +1122,80 @@ static SENSOR_DEVICE_ATTR_2(fan5_input, S_IRUGO, show_fan, NULL, 4, 0);
static SENSOR_DEVICE_ATTR_2(fan5_min, S_IRUGO | S_IWUSR, show_fan, set_fan, static SENSOR_DEVICE_ATTR_2(fan5_min, S_IRUGO | S_IWUSR, show_fan, set_fan,
4, 1); 4, 1);
#define show_pwm_offset(offset) \ static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR,
static SENSOR_DEVICE_ATTR(pwm##offset##_enable, S_IRUGO | S_IWUSR, \ show_pwm_enable, set_pwm_enable, 0);
show_pwm_enable, set_pwm_enable, offset - 1); \ static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 0);
static SENSOR_DEVICE_ATTR(pwm##offset, S_IRUGO | S_IWUSR, \ static DEVICE_ATTR(pwm1_freq, S_IRUGO | S_IWUSR, show_pwm_freq, set_pwm_freq);
show_pwm, set_pwm, offset - 1); \ static SENSOR_DEVICE_ATTR(pwm1_auto_channels_temp, S_IRUGO | S_IWUSR,
static DEVICE_ATTR(pwm##offset##_freq, \ show_pwm_temp_map, set_pwm_temp_map, 0);
(offset == 1 ? S_IRUGO | S_IWUSR : S_IRUGO), \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_pwm, S_IRUGO | S_IWUSR,
show_pwm_freq, (offset == 1 ? set_pwm_freq : NULL)); \ show_auto_pwm, set_auto_pwm, 0, 0);
static SENSOR_DEVICE_ATTR(pwm##offset##_auto_channels_temp, \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_pwm, S_IRUGO | S_IWUSR,
S_IRUGO | S_IWUSR, show_pwm_temp_map, set_pwm_temp_map, \ show_auto_pwm, set_auto_pwm, 0, 1);
offset - 1); \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_pwm, S_IRUGO | S_IWUSR,
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_pwm, \ show_auto_pwm, set_auto_pwm, 0, 2);
S_IRUGO | S_IWUSR, show_auto_pwm, set_auto_pwm, \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_pwm, S_IRUGO,
offset - 1, 0); \ show_auto_pwm, NULL, 0, 3);
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point2_pwm, \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp, S_IRUGO | S_IWUSR,
S_IRUGO | S_IWUSR, show_auto_pwm, set_auto_pwm, \ show_auto_temp, set_auto_temp, 0, 1);
offset - 1, 1); \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point1_temp_hyst, S_IRUGO | S_IWUSR,
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point3_pwm, \ show_auto_temp, set_auto_temp, 0, 0);
S_IRUGO | S_IWUSR, show_auto_pwm, set_auto_pwm, \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point2_temp, S_IRUGO | S_IWUSR,
offset - 1, 2); \ show_auto_temp, set_auto_temp, 0, 2);
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point4_pwm, \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point3_temp, S_IRUGO | S_IWUSR,
S_IRUGO, show_auto_pwm, NULL, offset - 1, 3); \ show_auto_temp, set_auto_temp, 0, 3);
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_temp, \ static SENSOR_DEVICE_ATTR_2(pwm1_auto_point4_temp, S_IRUGO | S_IWUSR,
S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ show_auto_temp, set_auto_temp, 0, 4);
offset - 1, 1); \
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point1_temp_hyst, \ static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO | S_IWUSR,
S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ show_pwm_enable, set_pwm_enable, 1);
offset - 1, 0); \ static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 1);
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point2_temp, \ static DEVICE_ATTR(pwm2_freq, S_IRUGO, show_pwm_freq, NULL);
S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ static SENSOR_DEVICE_ATTR(pwm2_auto_channels_temp, S_IRUGO | S_IWUSR,
offset - 1, 2); \ show_pwm_temp_map, set_pwm_temp_map, 1);
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point3_temp, \ static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_pwm, S_IRUGO | S_IWUSR,
S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ show_auto_pwm, set_auto_pwm, 1, 0);
offset - 1, 3); \ static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_pwm, S_IRUGO | S_IWUSR,
static SENSOR_DEVICE_ATTR_2(pwm##offset##_auto_point4_temp, \ show_auto_pwm, set_auto_pwm, 1, 1);
S_IRUGO | S_IWUSR, show_auto_temp, set_auto_temp, \ static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_pwm, S_IRUGO | S_IWUSR,
offset - 1, 4); show_auto_pwm, set_auto_pwm, 1, 2);
static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_pwm, S_IRUGO,
show_pwm_offset(1); show_auto_pwm, NULL, 1, 3);
show_pwm_offset(2); static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR,
show_pwm_offset(3); show_auto_temp, set_auto_temp, 1, 1);
static SENSOR_DEVICE_ATTR_2(pwm2_auto_point1_temp_hyst, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 1, 0);
static SENSOR_DEVICE_ATTR_2(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 1, 2);
static SENSOR_DEVICE_ATTR_2(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 1, 3);
static SENSOR_DEVICE_ATTR_2(pwm2_auto_point4_temp, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 1, 4);
static SENSOR_DEVICE_ATTR(pwm3_enable, S_IRUGO | S_IWUSR,
show_pwm_enable, set_pwm_enable, 2);
static SENSOR_DEVICE_ATTR(pwm3, S_IRUGO | S_IWUSR, show_pwm, set_pwm, 2);
static DEVICE_ATTR(pwm3_freq, S_IRUGO, show_pwm_freq, NULL);
static SENSOR_DEVICE_ATTR(pwm3_auto_channels_temp, S_IRUGO | S_IWUSR,
show_pwm_temp_map, set_pwm_temp_map, 2);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_pwm, S_IRUGO | S_IWUSR,
show_auto_pwm, set_auto_pwm, 2, 0);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_pwm, S_IRUGO | S_IWUSR,
show_auto_pwm, set_auto_pwm, 2, 1);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point3_pwm, S_IRUGO | S_IWUSR,
show_auto_pwm, set_auto_pwm, 2, 2);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point4_pwm, S_IRUGO,
show_auto_pwm, NULL, 2, 3);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_temp, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 2, 1);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point1_temp_hyst, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 2, 0);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point2_temp, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 2, 2);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point3_temp, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 2, 3);
static SENSOR_DEVICE_ATTR_2(pwm3_auto_point4_temp, S_IRUGO | S_IWUSR,
show_auto_temp, set_auto_temp, 2, 4);
/* Alarms */ /* Alarms */
static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, static ssize_t show_alarms(struct device *dev, struct device_attribute *attr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment