From patchwork Fri Jun 24 10:49:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102091 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp880227qgy; Fri, 24 Jun 2016 03:49:13 -0700 (PDT) X-Received: by 10.98.106.133 with SMTP id f127mr5978020pfc.139.1466765352672; Fri, 24 Jun 2016 03:49:12 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l190si6240928pfc.53.2016.06.24.03.49.12; Fri, 24 Jun 2016 03:49:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751400AbcFXKs4 (ORCPT + 30 others); Fri, 24 Jun 2016 06:48:56 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:50208 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbcFXKsw (ORCPT ); Fri, 24 Jun 2016 06:48:52 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue104) with ESMTPA (Nemesis) id 0Lr24R-1buQ6p18AF-00eakX; Fri, 24 Jun 2016 12:48:12 +0200 From: Arnd Bergmann To: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org, Sascha Hauer , Fabio Estevam , linux-kernel@vger.kernel.org, Arnd Bergmann Subject: [PATCH 4/6] ARM: imx: rework mx27_pm_init() call Date: Fri, 24 Jun 2016 12:49:59 +0200 Message-Id: <20160624105001.3166287-5-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20160624105001.3166287-1-arnd@arndb.de> References: <20160624105001.3166287-1-arnd@arndb.de> X-Provags-ID: V03:K0:QvrD/g6vHHQDfG3xxxUqBJSyhuDqPYtf8ekMnZuhf0k8ckNpocz FigR24tH7TjnGoX/RPKjtMz6ujEJHrQHxd1wIMnT165+GxcmXZuUcDm3Ou+MeUrRp94Vh0u axqTdEHofaUA+FmkiHocogtzq4l7NpPjebLurrH8OPq40csZN1IqSBkLge5tz05hjX3jJaS qCqXLeC8jphdyzxuSGJhQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:U+0+XBc8Des=:D/KWLIH55yL0VcKSPqWgw/ 4mX9PKHK48caAXlIRXOBOQZeYeaxkM4yFrENOwA6ySbnMSpL33ipRN3gV3qvbEuWBhBsIf9y0 2jtsku6AJ0W+ZyB7vOOutFryVWI/QprrKRLO1QM9nfaNyt+K3vdduQ/5aKEQBke3uSIaTHH02 t2i/U9+1TpHgM7rsUmgzCVwT00Js1/3x5LFW6c4b/TrwtYjGESqKqW0/ZlZUdnfjWLvWn2Ptt ilfK7xr4dcY5N4HPYRlV1uBYdgZYphB2SIBMN30qKmR0NFWJnMj019pwGUNq5b9boK4hNDMfd WxWRF59AQ8xmEfAAcaBYDdwG+lYFRZboarhuaCeIUArPH+41dJc1PMXgkAcI8qezhhamKNqyy 46/9cSy0uK8p9YAHrDGnyMbOLMsLBxj0umU37gxKEoieCb1egDg7xK1xY1nPYMdUhX/gHX4Gd I1gCqt/jyyTf5zAS4XnQmp1lSRZU+zvKTjh5HBmrUTkoh0eRHP2YddVb1qB6Rl/TsMjLUYzq1 GkDTYiPWiQo/Oys/CH+VsX+FaE3FoTNnG+N381yf1o1TtitvDsCA95AzkXnNxJp2FsL1fFOtQ r8TyZ5rmqzG+aRICjfHcb3VNkcd+2gWE6Yxff3OgC/m5LICtCTDtVvKd+XKsjwh+/CHJcclnA 0KGVC8N20QJ78z/DgJN6gQxdO9SFYspv/ShacxNnQGwxl+VYobZUU/nW5QvBM8EUXxb0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mx27_pm_init() uses its own initcall, unlike all of the other functions like it. Replacing the initcall with a .init_late() callback makes imx27 more like the others and lets us remove the last caller of cpu_is_mx27(). Signed-off-by: Arnd Bergmann --- arch/arm/mach-imx/common.h | 1 + arch/arm/mach-imx/imx27-dt.c | 1 + arch/arm/mach-imx/mm-imx27.c | 2 ++ arch/arm/mach-imx/pm-imx27.c | 8 +------- 4 files changed, 5 insertions(+), 7 deletions(-) -- 2.9.0 diff --git a/arch/arm/mach-imx/common.h b/arch/arm/mach-imx/common.h index 0a1d1f175b7a..a8f469333027 100644 --- a/arch/arm/mach-imx/common.h +++ b/arch/arm/mach-imx/common.h @@ -67,6 +67,7 @@ void imx_gpc_set_arm_power_in_lpm(bool power_off); void imx_gpc_set_arm_power_up_timing(u32 sw2iso, u32 sw); void imx_gpc_set_arm_power_down_timing(u32 sw2iso, u32 sw); void imx25_pm_init(void); +void imx27_pm_init(void); enum mxc_cpu_pwr_mode { WAIT_CLOCKED, /* wfi only */ diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c index 26490de9c038..6a94553dc13d 100644 --- a/arch/arm/mach-imx/imx27-dt.c +++ b/arch/arm/mach-imx/imx27-dt.c @@ -26,5 +26,6 @@ static const char * const imx27_dt_board_compat[] __initconst = { DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") .map_io = mx27_map_io, .init_irq = mx27_init_irq, + .init_late = imx27_pm_init, .dt_compat = imx27_dt_board_compat, MACHINE_END diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c index 7d82a5a5b16b..862b9b7762c7 100644 --- a/arch/arm/mach-imx/mm-imx27.c +++ b/arch/arm/mach-imx/mm-imx27.c @@ -98,4 +98,6 @@ void __init imx27_soc_init(void) /* imx27 has the imx21 type audmux */ platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res, ARRAY_SIZE(imx27_audmux_res)); + + imx27_pm_init(); } diff --git a/arch/arm/mach-imx/pm-imx27.c b/arch/arm/mach-imx/pm-imx27.c index 43096c8990d4..d943535566c8 100644 --- a/arch/arm/mach-imx/pm-imx27.c +++ b/arch/arm/mach-imx/pm-imx27.c @@ -37,13 +37,7 @@ static const struct platform_suspend_ops mx27_suspend_ops = { .valid = suspend_valid_only_mem, }; -static int __init mx27_pm_init(void) +void __init imx27_pm_init(void) { - if (!cpu_is_mx27()) - return 0; - suspend_set_ops(&mx27_suspend_ops); - return 0; } - -device_initcall(mx27_pm_init);