summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm87.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2007-05-08 17:21:59 +0200
committerJean Delvare <khali@hyperion.delvare>2007-05-08 17:21:59 +0200
commit8a665a0552c414af88788cc0e2cf0e4626182c20 (patch)
tree52b23555f5e240d81180cf4aab82b90bca804d1b /drivers/hwmon/lm87.c
parent94e183fd0425a917d9c1453041ef88f3610c0f01 (diff)
downloadkernel-crypto-8a665a0552c414af88788cc0e2cf0e4626182c20.tar.gz
kernel-crypto-8a665a0552c414af88788cc0e2cf0e4626182c20.tar.xz
kernel-crypto-8a665a0552c414af88788cc0e2cf0e4626182c20.zip
hwmon: Only call vid_which_vrm() when needed
Some hardware monitoring drivers create the VID/VRM interface files conditionally depending on the chip model or configuration. We should only call vid_which_vrm() when we are actually going to create the files. Not only it is more logical and efficient that way, but it also prevents printing unnecessary warnings such as the one reported here: http://lists.lm-sensors.org/pipermail/lm-sensors/2007-February/018954.html Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/lm87.c')
-rw-r--r--drivers/hwmon/lm87.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index 3ce825489e3..988ae1c4aad 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -747,6 +747,7 @@ static int lm87_detect(struct i2c_adapter *adapter, int address, int kind)
}
if (!(data->channel & CHAN_NO_VID)) {
+ data->vrm = vid_which_vrm();
if ((err = device_create_file(&new_client->dev,
&dev_attr_cpu0_vid))
|| (err = device_create_file(&new_client->dev,
@@ -779,7 +780,6 @@ static void lm87_init_client(struct i2c_client *client)
u8 config;
data->channel = lm87_read_value(client, LM87_REG_CHANNEL_MODE);
- data->vrm = vid_which_vrm();
config = lm87_read_value(client, LM87_REG_CONFIG);
if (!(config & 0x01)) {