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)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 20 Nov 2012 11:21:12 +0000 (12:21 +0100)
commitb9fbb62eb61452d728c39b2e5020739c575aac53
tree0cba6c18d652ea5f43972245ea07ef30a639a91f
parentd511b9c3626c83874824b1118f8a2e84ef63a7d3
mfd: Only unregister platform devices allocated by the mfd core

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.

Cc: stable@vger.kernel.org
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>
drivers/mfd/mfd-core.c