aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/w83781d.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-05-16 12:52:38 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-22 00:51:57 -0400
commit68188ba7de2db9999ff08a4544a78b2f10eb08bd (patch)
tree37e0406d7f2b6ace2bc73043bda0c745d3aa5e37 /drivers/i2c/chips/w83781d.c
parentff3240946d6a3d9f2ecf273f7330e09eec5484eb (diff)
[PATCH] I2C: Kill common macro abuse in chip drivers
This patch kills a common macro abuse in i2c chip drivers: defining ALARMS_FROM_REG returning its argument unchanged. Dropping the macro makes the code somewhat more readable IMHO. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/chips/w83781d.c')
-rw-r--r--drivers/i2c/chips/w83781d.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
index f47aee88e20c..4a5b06ba57d3 100644
--- a/drivers/i2c/chips/w83781d.c
+++ b/drivers/i2c/chips/w83781d.c
@@ -172,7 +172,6 @@ FAN_TO_REG(long rpm, int div)
172 : (val)) / 1000, 0, 0xff)) 172 : (val)) / 1000, 0, 0xff))
173#define TEMP_FROM_REG(val) (((val) & 0x80 ? (val)-0x100 : (val)) * 1000) 173#define TEMP_FROM_REG(val) (((val) & 0x80 ? (val)-0x100 : (val)) * 1000)
174 174
175#define ALARMS_FROM_REG(val) (val)
176#define PWM_FROM_REG(val) (val) 175#define PWM_FROM_REG(val) (val)
177#define PWM_TO_REG(val) (SENSORS_LIMIT((val),0,255)) 176#define PWM_TO_REG(val) (SENSORS_LIMIT((val),0,255))
178#define BEEP_MASK_FROM_REG(val,type) ((type) == as99127f ? \ 177#define BEEP_MASK_FROM_REG(val,type) ((type) == as99127f ? \
@@ -523,7 +522,7 @@ static ssize_t
523show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf) 522show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf)
524{ 523{
525 struct w83781d_data *data = w83781d_update_device(dev); 524 struct w83781d_data *data = w83781d_update_device(dev);
526 return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); 525 return sprintf(buf, "%u\n", data->alarms);
527} 526}
528 527
529static 528static