hwmon: (via686a) Initialize fan_div values
commit8a6b2302842388a5f228236e4fdf11ccc97368b6
authorJean Delvare <khali@linux-fr.org>
Wed, 12 Jan 2011 20:55:09 +0000 (12 21:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Apr 2011 14:52:54 +0000 (30 16:52 +0200)
treeba9c5e5202e0e1af3f4795e0852f980156c61df0
parentd2e3039c4b9f07adca7f8f274fa5d3d5c06fb179
hwmon: (via686a) Initialize fan_div values

commit f790674d3f87df6390828ac21a7d1530f71b59c8 upstream.

Functions set_fan_min() and set_fan_div() assume that the fan_div
values have already been read from the register. The driver currently
doesn't initialize them at load time, they are only set when function
via686a_update_device() is called. This means that set_fan_min() and
set_fan_div() misbehave if, for example, "sensors -s" is called
before any monitoring application (e.g. "sensors") is has been run.

Fix the problem by always initializing the fan_div values at device
bind time.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/via686a.c