From patchwork Wed Jan 14 12:11:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 5630731 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 DBECE9F357 for ; Wed, 14 Jan 2015 12:17:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED90C20384 for ; Wed, 14 Jan 2015 12:17:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 218B620395 for ; Wed, 14 Jan 2015 12:17:10 +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 1YBMrT-0007aU-CM; Wed, 14 Jan 2015 12:15:47 +0000 Received: from michel.telenet-ops.be ([195.130.137.88]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBMni-0004jR-SJ for linux-arm-kernel@lists.infradead.org; Wed, 14 Jan 2015 12:11:56 +0000 Received: from ayla.of.borg ([84.193.93.87]) by michel.telenet-ops.be with bizsmtp id foBW1p00D1t5w8s06oBW6K; Wed, 14 Jan 2015 13:11:30 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1YBMnJ-0002kI-VZ; Wed, 14 Jan 2015 13:11:30 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1YBMnN-0004Od-Lo; Wed, 14 Jan 2015 13:11:33 +0100 From: Geert Uytterhoeven To: Simon Horman , Magnus Damm Subject: [PATCH v2 2/6] ARM: shmobile: R-Mobile: Consolidate rmobile_pd_suspend_*() Date: Wed, 14 Jan 2015 13:11:20 +0100 Message-Id: <1421237484-16847-3-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421237484-16847-1-git-send-email-geert+renesas@glider.be> References: <1421237484-16847-1-git-send-email-geert+renesas@glider.be> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150114_041155_116244_9E0F213E X-CRM114-Status: GOOD ( 13.63 ) X-Spam-Score: -0.7 (/) Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Consolidate the identical rmobile_pd_suspend_*() routines that just return -EBUSY to prevent a PM domain from being powered down into a single rmobile_pd_suspend_busy(). Signed-off-by: Geert Uytterhoeven --- v2: - Break long comment. --- arch/arm/mach-shmobile/pm-rmobile.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 85a7fdd9823bc5a6..e1be4b8919efe30e 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c @@ -200,11 +200,10 @@ void rmobile_add_devices_to_domains(struct pm_domain_device data[], #else /* !CONFIG_ARCH_SHMOBILE_LEGACY */ -static int rmobile_pd_suspend_cpu(void) +static int rmobile_pd_suspend_busy(void) { /* - * This domain contains the CPU core and therefore it should - * only be turned off if the CPU is not in use. + * This domain should not be turned off. */ return -EBUSY; } @@ -218,16 +217,6 @@ static int rmobile_pd_suspend_console(void) return console_suspend_enabled ? 0 : -EBUSY; } -static int rmobile_pd_suspend_debug(void) -{ - /* - * This domain contains the Coresight-ETM hardware block and - * therefore it should only be turned off if the debug module is - * not in use. - */ - return -EBUSY; -} - #define MAX_NUM_CPU_PDS 8 static unsigned int num_cpu_pds __initdata; @@ -303,17 +292,26 @@ static void __init rmobile_setup_pm_domain(struct device_node *np, const char *name = pd->genpd.name; if (pd_contains_cpu(np)) { + /* + * This domain contains the CPU core and therefore it should + * only be turned off if the CPU is not in use. + */ pr_debug("PM domain %s contains CPU\n", name); pd->gov = &pm_domain_always_on_gov; - pd->suspend = rmobile_pd_suspend_cpu; + pd->suspend = rmobile_pd_suspend_busy; } else if (np == console_pd) { pr_debug("PM domain %s contains serial console\n", name); pd->gov = &pm_domain_always_on_gov; pd->suspend = rmobile_pd_suspend_console; } else if (np == debug_pd) { + /* + * This domain contains the Coresight-ETM hardware block and + * therefore it should only be turned off if the debug module + * is not in use. + */ pr_debug("PM domain %s contains Coresight-ETM\n", name); pd->gov = &pm_domain_always_on_gov; - pd->suspend = rmobile_pd_suspend_debug; + pd->suspend = rmobile_pd_suspend_busy; } rmobile_init_pm_domain(pd);