]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mfd: Only unregister platform devices allocated by the mfd core
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Fri, 9 Nov 2012 16:15:28 +0000 (16:15 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 3 Jan 2013 03:33:13 +0000 (03:33 +0000)
commite417ac027a2b834fe0dfc58c59e1a50828b8a577
tree6ff1b43816c6ba5d5c758e9f399bdd0638698e3e
parent56bd27c70e51a909f768f6bb62e93ad78e5c87e2
mfd: Only unregister platform devices allocated by the mfd core

commit b9fbb62eb61452d728c39b2e5020739c575aac53 upstream.

mfd_remove_devices would iterate over all devices sharing a parent with
an mfd device regardless of whether they were allocated by the mfd core
or not. This especially caused problems when the device structure was
not contained within a platform_device, because to_platform_device is
used on each device pointer.

This patch defines a device_type for mfd devices and checks this is
present from mfd_remove_devices_fn before processing the device.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Tested-by: Peter Tyser <ptyser@xes-inc.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/mfd/mfd-core.c