aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/asb100.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/asb100.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/asb100.c')
-rw-r--r--drivers/i2c/chips/asb100.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/i2c/chips/asb100.c b/drivers/i2c/chips/asb100.c
index 342b1a98a8cc..70d996d6fe0a 100644
--- a/drivers/i2c/chips/asb100.c
+++ b/drivers/i2c/chips/asb100.c
@@ -169,8 +169,6 @@ static int ASB100_PWM_FROM_REG(u8 reg)
169 return reg * 16; 169 return reg * 16;
170} 170}
171 171
172#define ALARMS_FROM_REG(val) (val)
173
174#define DIV_FROM_REG(val) (1 << (val)) 172#define DIV_FROM_REG(val) (1 << (val))
175 173
176/* FAN DIV: 1, 2, 4, or 8 (defaults to 2) 174/* FAN DIV: 1, 2, 4, or 8 (defaults to 2)
@@ -557,7 +555,7 @@ device_create_file(&client->dev, &dev_attr_vrm);
557static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf) 555static ssize_t show_alarms(struct device *dev, struct device_attribute *attr, char *buf)
558{ 556{
559 struct asb100_data *data = asb100_update_device(dev); 557 struct asb100_data *data = asb100_update_device(dev);
560 return sprintf(buf, "%d\n", ALARMS_FROM_REG(data->alarms)); 558 return sprintf(buf, "%u\n", data->alarms);
561} 559}
562 560
563static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL); 561static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);