From patchwork Wed Jan 4 16:08:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 134288 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A6EBD1007D6 for ; Thu, 5 Jan 2012 03:11:20 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756163Ab2ADQLA (ORCPT ); Wed, 4 Jan 2012 11:11:00 -0500 Received: from hqemgate04.nvidia.com ([216.228.121.35]:17545 "EHLO hqemgate04.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754584Ab2ADQK7 (ORCPT ); Wed, 4 Jan 2012 11:10:59 -0500 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Wed, 04 Jan 2012 08:09:43 -0800 Received: from hqnvemgw02.nvidia.com ([172.17.108.22]) by hqnvupgp08.nvidia.com (PGP Universal service); Wed, 04 Jan 2012 08:10:59 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Wed, 04 Jan 2012 08:10:59 -0800 Received: from daphne.nvidia.com (Not Verified[172.16.212.96]) by hqnvemgw02.nvidia.com with MailMarshal (v6, 7, 2, 8378) id ; Wed, 04 Jan 2012 08:10:59 -0800 Received: from ldewangan-ubuntu.nvidia.com ([10.19.65.30]) by daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id q04GAtUX025698; Wed, 4 Jan 2012 08:10:57 -0800 (PST) From: Laxman Dewangan To: broonie@opensource.wolfsonmicro.com, lrg@slimlogic.co.uk Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, ldewangan@nvidia.com Subject: [PATCH V1] regulator: fixed: Move drivers to subsys_initcall_sync() Date: Wed, 4 Jan 2012 21:38:55 +0530 Message-Id: <1325693335-1905-1-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.7.1.1 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Laxman Dewangan The fixed regulator is used to enable/disable rails which are mainly controlled by the switch. The switches are toggled by gpio apis. The switches are connected through on-chip gpios or through external devices' gpios like mfd, i2c based gpio expander etc. The registration of the fixed regulator get success only if the required gpios are already available in the system at this time. The on-chip gpios are available till this time as on-chip gpios are initialized in arch_init(). But external peripheral's gpios may not be available at this time as they get initialized as part of subsys_initcall() and due to this registration of the fixed regulator may fails. Moving the driver to subsys_initcall_sync() will make sure that all gpios i.e. on-chip gpios as well as external peripheral's gpios are available before fixed regulator registration. Signed-off-by: Laxman Dewangan --- drivers/regulator/fixed.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index a44a017..baec76e 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c @@ -307,7 +307,7 @@ static int __init regulator_fixed_voltage_init(void) { return platform_driver_register(®ulator_fixed_voltage_driver); } -subsys_initcall(regulator_fixed_voltage_init); +subsys_initcall_sync(regulator_fixed_voltage_init); static void __exit regulator_fixed_voltage_exit(void) {