From patchwork Mon Oct 26 09:46:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Liao X-Patchwork-Id: 7486541 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 00F369F36A for ; Mon, 26 Oct 2015 09:48:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C2AE207D4 for ; Mon, 26 Oct 2015 09:48:50 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 72B58207DA for ; Mon, 26 Oct 2015 09:48:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZqeMy-0001NZ-CK; Mon, 26 Oct 2015 09:47:12 +0000 Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZqeMu-0001IY-60; Mon, 26 Oct 2015 09:47:09 +0000 X-Listener-Flag: 11101 Received: from mtkhts09.mediatek.inc [(172.21.101.70)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1631088706; Mon, 26 Oct 2015 17:46:42 +0800 Received: from mtksdtcf04.mediatek.inc (10.21.12.144) by mtkhts09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 14.3.181.6; Mon, 26 Oct 2015 17:46:40 +0800 From: James Liao To: Subject: [PATCH] soc: mediatek: Init MT8173 scpsys driver earlier Date: Mon, 26 Oct 2015 17:46:37 +0800 Message-ID: <1445852797-15549-1-git-send-email-jamesjj.liao@mediatek.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151026_024708_438227_AA2293A6 X-CRM114-Status: GOOD ( 12.00 ) X-Spam-Score: -1.1 (-) 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: devicetree@vger.kernel.org, srv_heupstream@mediatek.com, Kevin Hilman , linux-kernel@vger.kernel.org, Daniel Kurtz , James Liao , linux-mediatek@lists.infradead.org, Sascha Hauer , Matthias Brugger Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some power domain comsumers may init before module_init. So the power domain provider (scpsys) need to be initialized earlier too. This patch modify scpsys driver init level from module_init to subsys_initcall. Signed-off-by: James Liao --- This patch is based on v4.3-rc7. drivers/soc/mediatek/mtk-scpsys.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c index 164a7d8..7d5d55d 100644 --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c @@ -485,4 +485,15 @@ static struct platform_driver scpsys_drv = { }, }; -module_platform_driver_probe(scpsys_drv, scpsys_probe); +static int __init scpsys_drv_init(void) +{ + return platform_driver_probe(&scpsys_drv, scpsys_probe); +} + +static void __exit scpsys_drv_exit(void) +{ + platform_driver_unregister(&scpsys_drv); +} + +subsys_initcall(scpsys_drv_init); +module_exit(scpsys_drv_exit);