Skip to content

Commit

Permalink
mfd: make mfd_remove_devices() iterate in reverse order
Browse files Browse the repository at this point in the history
The newly introduced device_for_each_child_reverse() would be used when MFD
core removes the device.

After this patch applied the devices will be removed in a reversed order. This
behaviour is useful when devices have implicit dependency on order, i.e.
consider MFD device with serial bus controller, such as SPI, and DMA IP that is
attached to serial bus controller: before remove the DMA driver we have to be
ensured that no DMA transfers is ongoing and the requested channel are unused.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Lee Jones committed Jul 28, 2015
1 parent 3d060ae commit b9a8a27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/mfd-core.c
Original file line number Diff line number Diff line change
@@ -302,7 +302,7 @@ void mfd_remove_devices(struct device *parent)
{
atomic_t *cnts = NULL;

device_for_each_child(parent, &cnts, mfd_remove_devices_fn);
device_for_each_child_reverse(parent, &cnts, mfd_remove_devices_fn);
kfree(cnts);
}
EXPORT_SYMBOL(mfd_remove_devices);

0 comments on commit b9a8a27

Please sign in to comment.