]> asedeno.scripts.mit.edu Git - linux.git/commit
hwmon: (coretemp) Use proper error codes in cpu online callback
authorThomas Gleixner <tglx@linutronix.de>
Tue, 22 Nov 2016 17:42:05 +0000 (17:42 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 10 Dec 2016 05:54:11 +0000 (21:54 -0800)
commit2195c31b127def509c806fe8a9d3b4092a28ce31
treee0302cafd49446a2bed140482ba9c0ed3a72df2c
parente00ca5df37adc68052ea699cbd010ee4e19e39e4
hwmon: (coretemp) Use proper error codes in cpu online callback

The cpu online callback returns success unconditionally even when the
device has no support, micro code mismatches or device allocation fails.
Only if CPU_HOTPLUG is disabled, the init function checks whether the
device list is empty and removes the driver.

This does not make sense. If CPU HOTPLUG is enabled then there is no point
to keep the driver around when it failed to initialize on the already
online cpus. The chance that not yet online CPUs will provide a functional
interface later is very close to zero.

Add proper error return codes, so the setup of the cpu hotplug states fails
when the device cannot be initialized and remove all the magic cruft.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/coretemp.c