From: Guenter Roeck Date: Sun, 11 Nov 2012 22:51:33 +0000 (+1100) Subject: hwmon: (it87) Replace macro defining tempX_type sensors with direct definitions X-Git-Tag: next-20121112~85^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ce2f883221d0b3cf38000f1b638df4e5b04ae159;p=karo-tx-linux.git hwmon: (it87) Replace macro defining tempX_type sensors with direct definitions The macro name show_sensor_offset is confusing since it related to the sensor type, not an offset - even more so when we introduce offset attributes later on. Replace it with direct definitions, and replace the show_sensor/set_sensor function names with show_temp_type/set_temp_type. This also resolves a checkpatch error. Signed-off-by: Guenter Roeck Signed-off-by: Jean Delvare --- diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 20c5f040ab47..b6d72534d4d6 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -576,8 +576,8 @@ static SENSOR_DEVICE_ATTR_2(temp3_min, S_IRUGO | S_IWUSR, show_temp, set_temp, static SENSOR_DEVICE_ATTR_2(temp3_max, S_IRUGO | S_IWUSR, show_temp, set_temp, 2, 2); -static ssize_t show_sensor(struct device *dev, struct device_attribute *attr, - char *buf) +static ssize_t show_temp_type(struct device *dev, struct device_attribute *attr, + char *buf) { struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); int nr = sensor_attr->index; @@ -590,8 +590,9 @@ static ssize_t show_sensor(struct device *dev, struct device_attribute *attr, return sprintf(buf, "4\n"); /* thermistor */ return sprintf(buf, "0\n"); /* disabled */ } -static ssize_t set_sensor(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) + +static ssize_t set_temp_type(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); int nr = sensor_attr->index; @@ -626,13 +627,13 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr, mutex_unlock(&data->update_lock); return count; } -#define show_sensor_offset(offset) \ -static SENSOR_DEVICE_ATTR(temp##offset##_type, S_IRUGO | S_IWUSR, \ - show_sensor, set_sensor, offset - 1); -show_sensor_offset(1); -show_sensor_offset(2); -show_sensor_offset(3); +static SENSOR_DEVICE_ATTR(temp1_type, S_IRUGO | S_IWUSR, show_temp_type, + set_temp_type, 0); +static SENSOR_DEVICE_ATTR(temp2_type, S_IRUGO | S_IWUSR, show_temp_type, + set_temp_type, 1); +static SENSOR_DEVICE_ATTR(temp3_type, S_IRUGO | S_IWUSR, show_temp_type, + set_temp_type, 2); /* 3 Fans */