• Jim Cromie's avatar
    [PATCH] hwmon: (2/3) pc87360 driver update · 694fa056
    Jim Cromie authored
    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: default avatarJim Cromie <jim.cromie@gmail.com>
    Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
    694fa056
pc87360.c 45.2 KB