Skip to content

Commit a0cf354

Browse files
Jean DelvareJean Delvare
authored andcommitted
hwmon: (adm1026) Prevent log spamming
When debugging is enabled, the adm1026 driver currently logs the message "Setting VID from GPIO11-15" 108 times each time you run "sensors". Once should be enough. Signed-off-by: Jean Delvare <[email protected]> Cc: Philip Pokorny <[email protected]>
1 parent 885fe4b commit a0cf354

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/hwmon/adm1026.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ struct adm1026_data {
279279
u8 fan_min[8]; /* Register value */
280280
u8 fan_div[8]; /* Decoded value */
281281
struct pwm_data pwm1; /* Pwm control values */
282-
int vid; /* Decoded value */
283282
u8 vrm; /* VRM version */
284283
u8 analog_out; /* Register value (DAC) */
285284
long alarms; /* Register encoding, combined */
@@ -697,8 +696,6 @@ static struct adm1026_data *adm1026_update_device(struct device *dev)
697696
data->last_config = jiffies;
698697
}; /* last_config */
699698

700-
dev_dbg(&client->dev, "Setting VID from GPIO11-15.\n");
701-
data->vid = (data->gpio >> 11) & 0x1f;
702699
data->valid = 1;
703700
mutex_unlock(&data->update_lock);
704701
return data;
@@ -1215,7 +1212,10 @@ static DEVICE_ATTR(analog_out, S_IRUGO | S_IWUSR, show_analog_out_reg,
12151212
static ssize_t show_vid_reg(struct device *dev, struct device_attribute *attr, char *buf)
12161213
{
12171214
struct adm1026_data *data = adm1026_update_device(dev);
1218-
return sprintf(buf, "%d\n", vid_from_reg(data->vid & 0x3f, data->vrm));
1215+
int vid = (data->gpio >> 11) & 0x1f;
1216+
1217+
dev_dbg(dev, "Setting VID from GPIO11-15.\n");
1218+
return sprintf(buf, "%d\n", vid_from_reg(vid, data->vrm));
12191219
}
12201220
static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid_reg, NULL);
12211221

0 commit comments

Comments
 (0)