From: Jean Delvare Date: Sun, 31 Jan 2010 04:00:30 +0000 (+0000) Subject: macintosh/therm_adt746x: Fix sysfs attributes lifetime X-Git-Tag: v2.6.34-rc1~271^2~67 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33a470f6d5e1879c26f16f6b34dc09f82d44f6e9;p=pandora-kernel.git macintosh/therm_adt746x: Fix sysfs attributes lifetime Looking at drivers/macintosh/therm_adt746x.c, the sysfs files are created in thermostat_init() and removed in thermostat_exit(), which are the driver's init and exit functions. These files are backed-up by a per-device structure, so it looks like the wrong thing to do: the sysfs files have a lifetime longer than the data structure that is backing it up. I think that sysfs files creation should be moved to the end of probe_thermostat() and sysfs files removal should be moved to the beginning of remove_thermostat(). Signed-off-by: Jean Delvare Tested-by: Christian Kujau Cc: Benjamin Herrenschmidt Cc: Colin Leroy Cc: stable@kernel.org Signed-off-by: Benjamin Herrenschmidt --- Reading git-diff-tree failed