From: Hans de Goede Date: Wed, 7 Jan 2009 15:37:28 +0000 (+0100) Subject: hwmon: (f71882fg) Fix various sysfs callback function issues X-Git-Tag: v2.6.29-rc1~190^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce0bfa5ee25ddbe4072b16054e809f552bf72320;p=pandora-kernel.git hwmon: (f71882fg) Fix various sysfs callback function issues While working on adding F8000 support I noticed that various of the store sysfs functions (and a few of the show also) had issues. This patch fixes the following issues in these functions: * store: storing the result of strto[u]l in an int, resulting in a possible overflow before boundary checking * store: use of f71882fg_update_device(), we don't want to read the whole device in store functions, just the registers we need * store: use of cached register values instead of reading the needed regs in the store function, including cases where f71882fg_update_device() was not used, this could cause real isues * show: shown value is a calculation of 2 or more cached register reads, without locking the data struct. Signed-off-by: Hans de Goede Signed-off-by: Jean Delvare --- Reading git-diff-tree failed