From patchwork Tue Jul 24 16:49:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 10542595 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3E8D7112E for ; Tue, 24 Jul 2018 16:51:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C8AA291B9 for ; Tue, 24 Jul 2018 16:51:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A983291A2; Tue, 24 Jul 2018 16:51:36 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CAB392906F for ; Tue, 24 Jul 2018 16:51:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K6LRVCelJpTdYEg8n4LWqZYNIpju18cdy3UrPpMcjKw=; b=Ka5tBxo5BbIY7p PldEkPq1OJ12AWoqGEhDAUb8JD0/T/5U82py72QUQJJDQz85SYy36IPdSOBRQdMKT6KGEm1jnaPT6 NuZN/ggmicSMgMgkLWAsiU6x5TIcHr6CzQYab2ZOywdK3BTXsiHyo916wTiCBOfuoRB+VmS3ZZREo WckjOF73ImsMroAKuv3vY5+uWBkj5apA+QPBGyMhpqGzagyS4XX2OWf6X2c9lN9xpXxrSTlV2B473 rXuB+JcYFOrN21msItHOgTwW8B5MRBWt2W9Ebj2YvrxbGlSCPlAYI9oInsF2y4pwSuQhny/MUq+PF 7z4+YE1KMm/U/0hnQZ2g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi0X4-0002JP-J6; Tue, 24 Jul 2018 16:51:30 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fi0WA-0000qO-VN for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2018 16:50:40 +0000 Received: from localhost.localdomain (xdsl-188-155-58-14.adslplus.ch [188.155.58.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E19A020882; Tue, 24 Jul 2018 16:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532451026; bh=xWLknxL1PDXVCqTR6qH5NCeCvJ9qCdNL8y3YzjJn6Gk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dRPGxVEtpDLYG0bzW3UVVTBEr1eNh0amammxdUwBw9CoGvOk54ld1nNpPu0+gzxCZ BNL+y/s3R78EAGGzi+oD0D58Ubx1swKOzOV+kJshX7EKGTpx0TIv34i9pOlKa6ivAN p6P3S5bEpQAhqGfEP/Zjmo/dJOMGciRvVIde29VU= From: Krzysztof Kozlowski To: Kukjin Kim , Krzysztof Kozlowski , Russell King , Alim Akhtar , Marek Szyprowski , Pankaj Dubey , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] ARM: exynos: Store Exynos5420 register state in one variable Date: Tue, 24 Jul 2018 18:49:44 +0200 Message-Id: <20180724164946.6274-2-krzk@kernel.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180724164946.6274-1-krzk@kernel.org> References: <20180724164946.6274-1-krzk@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180724_095035_104139_CF4922AB X-CRM114-Status: GOOD ( 15.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Instead of keeping two static variables put them into one struct which later can grow. This will reduce number of file-scope symbols. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: New patch. --- arch/arm/mach-exynos/suspend.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index d3db306a5a70..5d4822e5d0ba 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -59,10 +59,14 @@ struct exynos_pm_data { int (*cpu_suspend)(unsigned long); }; -static const struct exynos_pm_data *pm_data __ro_after_init; +/* Used only on Exynos542x/5800 */ +struct exynos_pm_state { + int cpu_state; + unsigned int pmu_spare3; +}; -static int exynos5420_cpu_state; -static unsigned int exynos_pmu_spare3; +static const struct exynos_pm_data *pm_data __ro_after_init; +static struct exynos_pm_state pm_state; /* * GIC wake-up support @@ -320,7 +324,7 @@ static void exynos5420_pm_prepare(void) /* Set wake-up mask registers */ exynos_pm_set_wakeup_mask(); - exynos_pmu_spare3 = pmu_raw_readl(S5P_PMU_SPARE3); + pm_state.pmu_spare3 = pmu_raw_readl(S5P_PMU_SPARE3); /* * The cpu state needs to be saved and restored so that the * secondary CPUs will enter low power start. Though the U-Boot @@ -328,8 +332,8 @@ static void exynos5420_pm_prepare(void) * needs to restore it back in case, the primary cpu fails to * suspend for any reason. */ - exynos5420_cpu_state = readl_relaxed(sysram_base_addr + - EXYNOS5420_CPU_STATE); + pm_state.cpu_state = readl_relaxed(sysram_base_addr + + EXYNOS5420_CPU_STATE); exynos_pm_enter_sleep_mode(); @@ -447,7 +451,7 @@ static void exynos5420_pm_resume(void) EXYNOS5_ARM_CORE0_SYS_PWR_REG); /* Restore the sysram cpu state register */ - writel_relaxed(exynos5420_cpu_state, + writel_relaxed(pm_state.cpu_state, sysram_base_addr + EXYNOS5420_CPU_STATE); pmu_raw_writel(EXYNOS5420_USE_STANDBY_WFI_ALL, @@ -456,7 +460,7 @@ static void exynos5420_pm_resume(void) if (exynos_pm_central_resume()) goto early_wakeup; - pmu_raw_writel(exynos_pmu_spare3, S5P_PMU_SPARE3); + pmu_raw_writel(pm_state.pmu_spare3, S5P_PMU_SPARE3); early_wakeup: