]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (coretemp) Simplify package management
authorThomas Gleixner <tglx@linutronix.de>
Tue, 22 Nov 2016 17:42:06 +0000 (17:42 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 10 Dec 2016 05:54:13 +0000 (21:54 -0800)
commit712668460594294d74c13f2a023398a597fbe95f
treea58b1e0c9d064ed691bc38c9c362a115244eca04
parent2195c31b127def509c806fe8a9d3b4092a28ce31
hwmon: (coretemp) Simplify package management

Keeping track of the per package platform devices requires an extra object,
which is held in a linked list.

The maximum number of packages is known at init() time. So the extra object
and linked list management can be replaced by an array of platform device
pointers in which the per package devices pointers can be stored. Lookup
becomes a simple array lookup instead of a list walk.

The mutex protecting the list can be removed as well because the array is
only accessed from cpu hotplug callbacks which are already serialized.

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