From patchwork Thu Sep 8 01:48:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 9320279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 986F3601C0 for ; Thu, 8 Sep 2016 01:52:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85B5729485 for ; Thu, 8 Sep 2016 01:52:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A4B3294CE; Thu, 8 Sep 2016 01:52:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 71C3B294C8 for ; Thu, 8 Sep 2016 01:52:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bhoUE-0006yg-SJ; Thu, 08 Sep 2016 01:50:42 +0000 Received: from relay1.mentorg.com ([192.94.38.131]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bhoSW-0004Gu-MH for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2016 01:49:00 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1bhoSB-00040U-7U from Vladimir_Zapolskiy@mentor.com ; Wed, 07 Sep 2016 18:48:35 -0700 Received: from eyas.local (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 8 Sep 2016 02:48:33 +0100 From: Vladimir Zapolskiy To: Linus Walleij , Shawn Guo , Sascha Hauer , Fabio Estevam , Philipp Zabel Subject: [PATCH v2 2/3] gpio: mxc: shift gpio_mxc_init() to subsys_initcall level Date: Thu, 8 Sep 2016 04:48:15 +0300 Message-ID: <1473299296-22458-3-git-send-email-vladimir_zapolskiy@mentor.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1473299296-22458-1-git-send-email-vladimir_zapolskiy@mentor.com> References: <1473299296-22458-1-git-send-email-vladimir_zapolskiy@mentor.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.76] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160907_184857_059218_DE51CE22 X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-gpio@vger.kernel.org, Deepak Das , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In general situation on-SoC GPIO controller drivers should be probed after pinctrl/pinmux controller driver, because on-SoC GPIOs utilize a pin/pad as a resource provided and controlled by pinctrl subsystem. This is stated in multiple places, e.g. from drivers/Makefile: GPIO must come after pinctrl as gpios may need to mux pins etc Looking at Freescale iMX SoC series specifics, imx*_pinctrl_init() functions are called at arch_initcall and postcore_initcall init levels, so the change of initcall level for gpio-mxc driver from postcore_initcall to subsys_initcall level is sufficient. Also note that the most of GPIO controller drivers settled at subsys_initcall level. If pinctrl subsystem manages pads with GPIO functions, the change is needed to avoid unwanted driver probe deferrals during kernel boot. Signed-off-by: Vladimir Zapolskiy --- Changes from v1 to v2: * replaced by a change with better commit description and which moves gpio_mxc_init() call to subsys_initcall() instead of apparently too late device_initcall(), this mitigates Shawn's expressed concern about the change. drivers/gpio/gpio-mxc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index 1b342a3842c8..1fdd5d804b5b 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -510,7 +510,7 @@ static int __init gpio_mxc_init(void) { return platform_driver_register(&mxc_gpio_driver); } -postcore_initcall(gpio_mxc_init); +subsys_initcall(gpio_mxc_init); MODULE_AUTHOR("Freescale Semiconductor, " "Daniel Mack , "