From patchwork Tue Jan 20 01:27:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 5661671 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75139C058D for ; Tue, 20 Jan 2015 01:27:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B16A520394 for ; Tue, 20 Jan 2015 01:27:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5DC7203A5 for ; Tue, 20 Jan 2015 01:27:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbbATB1N (ORCPT ); Mon, 19 Jan 2015 20:27:13 -0500 Received: from kirsty.vergenet.net ([202.4.237.240]:59921 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750824AbbATB1N (ORCPT ); Mon, 19 Jan 2015 20:27:13 -0500 Received: from ayumi.isobedori.kobe.vergenet.net (p8130-ipbfp1005kobeminato.hyogo.ocn.ne.jp [118.10.149.130]) by kirsty.vergenet.net (Postfix) with ESMTP id B3330267176; Tue, 20 Jan 2015 12:27:11 +1100 (EST) Received: by ayumi.isobedori.kobe.vergenet.net (Postfix, from userid 7100) id 5EF1DEDE5C5; Tue, 20 Jan 2015 10:27:10 +0900 (JST) From: Simon Horman To: linux-sh@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Magnus Damm , Geert Uytterhoeven , Simon Horman Subject: [PATCH 1/3] ARM: shmobile: R-Mobile: Consolidate rmobile_pd_suspend_*() Date: Tue, 20 Jan 2015 10:27:07 +0900 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Geert Uytterhoeven 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 Signed-off-by: Simon Horman --- 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 85a7fdd..e1be4b8 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);