diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-05-16 12:52:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-22 00:51:57 -0400 |
commit | 68188ba7de2db9999ff08a4544a78b2f10eb08bd (patch) | |
tree | 37e0406d7f2b6ace2bc73043bda0c745d3aa5e37 /drivers/i2c/chips/lm85.c | |
parent | ff3240946d6a3d9f2ecf273f7330e09eec5484eb (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/lm85.c')
-rw-r--r-- | drivers/i2c/chips/lm85.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/i2c/chips/lm85.c b/drivers/i2c/chips/lm85.c index d618d1031301..b4d7fd418264 100644 --- a/drivers/i2c/chips/lm85.c +++ b/drivers/i2c/chips/lm85.c | |||
@@ -284,8 +284,6 @@ static int ZONE_TO_REG( int zone ) | |||
284 | /* i2c-vid.h defines vid_from_reg() */ | 284 | /* i2c-vid.h defines vid_from_reg() */ |
285 | #define VID_FROM_REG(val,vrm) (vid_from_reg((val),(vrm))) | 285 | #define VID_FROM_REG(val,vrm) (vid_from_reg((val),(vrm))) |
286 | 286 | ||
287 | #define ALARMS_FROM_REG(val) (val) | ||
288 | |||
289 | /* Unlike some other drivers we DO NOT set initial limits. Use | 287 | /* Unlike some other drivers we DO NOT set initial limits. Use |
290 | * the config file to set limits. Some users have reported | 288 | * the config file to set limits. Some users have reported |
291 | * motherboards shutting down when we set limits in a previous | 289 | * motherboards shutting down when we set limits in a previous |
@@ -480,7 +478,7 @@ static DEVICE_ATTR(vrm, S_IRUGO | S_IWUSR, show_vrm_reg, store_vrm_reg); | |||
480 | static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf) | 478 | static ssize_t show_alarms_reg(struct device *dev, struct device_attribute *attr, char *buf) |
481 | { | 479 | { |
482 | struct lm85_data *data = lm85_update_device(dev); | 480 | struct lm85_data *data = lm85_update_device(dev); |
483 | return sprintf(buf, "%ld\n", (long) ALARMS_FROM_REG(data->alarms)); | 481 | return sprintf(buf, "%u\n", data->alarms); |
484 | } | 482 | } |
485 | 483 | ||
486 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); | 484 | static DEVICE_ATTR(alarms, S_IRUGO, show_alarms_reg, NULL); |