[PATCH] hwmon: (2/3) pc87360 driver update
authorJim Cromie <jim.cromie@gmail.com>
Fri, 2 Sep 2005 20:57:52 +0000 (22:57 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Sep 2005 16:26:55 +0000 (09:26 -0700)
commit694fa056a60828ef54a5db958468cc600c3b3622
treead18cb871ffc475a6dfb7ff09dda6996b6e62f1b
parentf0986bd8f390392948db85dac526fb238752372b
[PATCH] hwmon: (2/3) pc87360 driver update

pc87360: number-skew to init

The temp, therm, fan, pwm callbacks all have an offset skew in the code
which accommodates attribute numbering conventions under
/sys/bus/i2c/devices/9191-6620/ (ie they start at 1)

This patch moves that skew into the declaration, and out of the
functions (except for therm, where we simplify from 2 skews to 1). The
declarative skew is clearer, less error-prone, and more efficient.

The use of 11+offset-4 below reflects the fact that the sysfs numbering
of these units is 4, 5, 6, but they use internal VLM units 11, 12, 13 to
measure the thermistor voltages.

There's one remaining skew factor, in *_crit callbacks below, because
there are no critical thresholds for voltages 0-10, only for those
supporting the thermistors.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/pc87360.c