From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932205AbbG1Hs1 (ORCPT ); Tue, 28 Jul 2015 03:48:27 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:37280 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932184AbbG1HsV (ORCPT ); Tue, 28 Jul 2015 03:48:21 -0400 Date: Tue, 28 Jul 2015 08:48:17 +0100 From: Lee Jones To: Andy Shevchenko Cc: linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org, Greg Kroah-Hartman , Vinod Koul , Mika Westerberg , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Heikki Krogerus , Jarkko Nikula , "Wysocki, Rafael J" , mturquette@baylibre.com, sboyd@codeaurora.org Subject: Re: [PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse order Message-ID: <20150728074817.GT21114@x1> References: <1438009443-55317-1-git-send-email-andriy.shevchenko@linux.intel.com> <1438009443-55317-7-git-send-email-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1438009443-55317-7-git-send-email-andriy.shevchenko@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Jul 2015, Andy Shevchenko wrote: > 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 > --- > drivers/mfd/mfd-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. Pull request to follow. > diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c > index 14fd5cb..c17635d 100644 > --- a/drivers/mfd/mfd-core.c > +++ b/drivers/mfd/mfd-core.c > @@ -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); -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog