From patchwork Fri Dec 9 10:31:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pankaj Dubey X-Patchwork-Id: 9467797 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 5619560586 for ; Fri, 9 Dec 2016 10:31:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BFEE2861B for ; Fri, 9 Dec 2016 10:31:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40BDC2861D; Fri, 9 Dec 2016 10:31:16 +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=unavailable 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 BF7212861B for ; Fri, 9 Dec 2016 10:31:15 +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 1cFIQj-000146-6h; Fri, 09 Dec 2016 10:29:29 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cFIQb-0000r5-JR for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2016 10:29:23 +0000 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OHW015WHYGAK210@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2016 19:28:58 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-21-584a876a73d9 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id E8.25.25310.A678A485; Fri, 9 Dec 2016 19:28:58 +0900 (KST) Received: from pankaj.sisodomain.com ([107.108.83.125]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OHW0034QYG1W670@mmp1.samsung.com>; Fri, 09 Dec 2016 19:28:58 +0900 (KST) From: Pankaj Dubey To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: EXYNOS: move exynos_pm_init into pm.c and remove init_late hook Date: Fri, 09 Dec 2016 16:01:17 +0530 Message-id: <1481279477-16463-1-git-send-email-pankaj.dubey@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsVy+t9jAd2sdq8Ig9sv1CzevF3DZNH/+DWz xfnzG9gtNj2+xmox4/w+JotFW7+wW3QsY3Rg99i0qpPNY/OSeo8t/XfZPfq2rGL0+LxJLoA1 ys0mIzUxJbVIITUvOT8lMy/dVik0xE3XQkkhLzE31VYpQtc3JEhJoSwxpxTIMzJAAw7OAe7B Svp2CW4ZR9c/Yy3YL1FxYdcU9gbGYyJdjJwcEgImEpuuvGSHsMUkLtxbz9bFyMUhJLCUUaLt 70VmCOcno8SBi7MYQarYBHQlnryfywxiiwh4S0w+8xesm1mgXuLO4TusILawQLhE49+bYPUs AqoSDx+sB7N5BTwkTj7YxgKxTU7i5rlO5gmM3AsYGVYxSqQWJBcUJ6XnGuallusVJ+YWl+al 6yXn525iBAfoM6kdjAd3uR9iFOBgVOLhrTjuGSHEmlhWXJl7iFGCg1lJhJe31StCiDclsbIq tSg/vqg0J7X4EKMp0AETmaVEk/OB0ZNXEm9oYm5ibmxgYW5paWKkJM7bOPtZuJBAemJJanZq akFqEUwfEwenVAOji9yZk5f3TQxO7T7KlG8bvnIJy9OWw+3NjoUstw8FVTKHLN6jUBc4u0dP sf9dRa72vhNvvhUXOHTMsPpcMnfiZKZZG5OUJX6/8RLcduWpzdRfjV3PF3tk/NWbYfN70aRd i4RehgWmPi+Ql6n7uIIxwKljwWNls3nLw8+1q8w2E/v3y0wx4eVlJZbijERDLeai4kQAvAlK UGYCAAA= X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161209_022921_893160_6A1BFB08 X-CRM114-Status: GOOD ( 13.30 ) 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: javier@osg.samsung.com, kgene@kernel.org, thomas.ab@samsung.com, krzk@kernel.org, Pankaj Dubey MIME-Version: 1.0 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 We can safely move exynos_pm_init into pm.c as late_initcall and remove init_late hook from exynos.c. This will remove extern declarations from common.h and move PM specific operations in pm.c rather being scattered across many files. Signed-off-by: Pankaj Dubey --- arch/arm/mach-exynos/common.h | 6 ------ arch/arm/mach-exynos/exynos.c | 10 ---------- arch/arm/mach-exynos/suspend.c | 13 ++++++++++--- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index fb12d11..cfd55ba 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h @@ -134,12 +134,6 @@ void exynos_clear_boot_flag(unsigned int cpu, unsigned int mode); extern u32 exynos_get_eint_wake_mask(void); -#ifdef CONFIG_PM_SLEEP -extern void __init exynos_pm_init(void); -#else -static inline void exynos_pm_init(void) {} -#endif - extern void exynos_cpu_resume(void); extern void exynos_cpu_resume_ns(void); diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index fa08ef9..040ea66 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c @@ -58,15 +58,6 @@ void __init exynos_sysram_init(void) } } -static void __init exynos_init_late(void) -{ - if (of_machine_is_compatible("samsung,exynos5440")) - /* to be supported later */ - return; - - exynos_pm_init(); -} - static int __init exynos_fdt_map_chipid(unsigned long node, const char *uname, int depth, void *data) { @@ -216,7 +207,6 @@ DT_MACHINE_START(EXYNOS_DT, "SAMSUNG EXYNOS (Flattened Device Tree)") .init_early = exynos_firmware_init, .init_irq = exynos_init_irq, .init_machine = exynos_dt_machine_init, - .init_late = exynos_init_late, .dt_compat = exynos_dt_compat, .dt_fixup = exynos_dt_fixup, MACHINE_END diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 73df9f3..f318b08 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -698,21 +698,25 @@ static const struct of_device_id exynos_pmu_of_device_ids[] __initconst = { static struct syscore_ops exynos_pm_syscore_ops; -void __init exynos_pm_init(void) +static int __init exynos_pm_init(void) { const struct of_device_id *match; struct device_node *np; u32 tmp; + if (of_machine_is_compatible("samsung,exynos5440")) + /* to be supported later */ + return 0; + np = of_find_matching_node_and_match(NULL, exynos_pmu_of_device_ids, &match); if (!np) { pr_err("Failed to find PMU node\n"); - return; + return -ENODEV; } if (WARN_ON(!of_find_property(np, "interrupt-controller", NULL))) { pr_warn("Outdated DT detected, suspend/resume will NOT work\n"); - return; + return -ENODEV; } pm_data = (const struct exynos_pm_data *) match->data; @@ -727,4 +731,7 @@ void __init exynos_pm_init(void) register_syscore_ops(&exynos_pm_syscore_ops); suspend_set_ops(&exynos_suspend_ops); + + return 0; } +late_initcall(exynos_pm_init);