From patchwork Tue Oct 15 07:50:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 3043931 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 182F59F2B6 for ; Tue, 15 Oct 2013 07:52:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6013A2011D for ; Tue, 15 Oct 2013 07:52:22 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B9FC200D4 for ; Tue, 15 Oct 2013 07:52:21 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVzPq-00072Q-OV; Tue, 15 Oct 2013 07:51:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVzPh-0008E2-O5; Tue, 15 Oct 2013 07:51:33 +0000 Received: from mail-wg0-f51.google.com ([74.125.82.51]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VVzPN-0008BN-N3 for linux-arm-kernel@lists.infradead.org; Tue, 15 Oct 2013 07:51:14 +0000 Received: by mail-wg0-f51.google.com with SMTP id l18so4202669wgh.30 for ; Tue, 15 Oct 2013 00:50:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5lS3swrBb5r5y3Xzs9ecj9gsO5y9/l3MaxrhBe8itQw=; b=X3DpoF+MfuBK+2qVX+657ReCTgS1lK3u3Q2zlDFunUL/bb1eWRIHPu3qO+Hq/LRHHV 86dhG+iBtG2I8HZcjYwQhHdcsEDlEXblfWK/D7bawo6e1eRjoeOzzZATr6JbizdBXmax BQmMkB53vFWndDywXIqTv2HZHa3W9mbWp9vjdLqR+7AtFDpmacpkGvZZezz3LwKeiIwS 90Mu7UFrP1AqQr8g8UugzbAEgVs3p5kdrsSeDcr+d3FFxxGrS/0ppREjhesEBEV6HPfG +/loflc1hhUMoVE8QTgljy7zS1/frQYfypABpz2xOV0jFSbGE0Fzauc+6on8D9FZuOtk ycnw== X-Gm-Message-State: ALoCoQnPFIYOo1fsT1m0ULmOKRWoAepOwdocrWZz0hZFXCqR5PHWNpbOfc8MNloSnb9nvkVUkLDM X-Received: by 10.180.100.33 with SMTP id ev1mr15024734wib.18.1381823451766; Tue, 15 Oct 2013 00:50:51 -0700 (PDT) Received: from mai.home (AToulouse-654-1-457-225.w83-205.abo.wanadoo.fr. [83.205.200.225]) by mx.google.com with ESMTPSA id i8sm3511560wiy.6.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 00:50:51 -0700 (PDT) From: Daniel Lezcano To: plagnioj@jcrosoft.com, linux@maxim.org.za, nicolas.ferre@atmel.com Subject: [PATCH V3 3/3] ARM: at91: pm: use standby callback instead of cpu_is Date: Tue, 15 Oct 2013 09:50:32 +0200 Message-Id: <1381823432-24944-3-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1381823432-24944-1-git-send-email-daniel.lezcano@linaro.org> References: <1381823432-24944-1-git-send-email-daniel.lezcano@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131015_035113_912341_CB4173AB X-CRM114-Status: GOOD ( 13.98 ) X-Spam-Score: -2.6 (--) Cc: thomas.petazzoni@free-electrons.com, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, b.zolnierkie@samsung.com, patches@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 The cpuidle's platform_device has the standby function set for the correct SoC when supported in the platform data. Remove the { if then else } statements in the at91_pm_enter by using directly the standby ops. Signed-off-by: Daniel Lezcano --- arch/arm/mach-at91/pm.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 76f8cbf..baeb4a4a 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -39,6 +39,8 @@ #include "at91_rstc.h" #include "at91_shdwc.h" +static void (*at91_pm_standby)(void); + static void __init show_reset_status(void) { static char reset[] __initdata = "reset"; @@ -266,14 +268,8 @@ static int at91_pm_enter(suspend_state_t state) * For ARM 926 based chips, this requirement is weaker * as at91sam9 can access a RAM in self-refresh mode. */ - if (cpu_is_at91rm9200()) - at91rm9200_standby(); - else if (cpu_is_at91sam9g45()) - at91sam9g45_standby(); - else if (cpu_is_at91sam9263()) - at91sam9263_standby(); - else - at91sam9_standby(); + if (at91_pm_standby) + at91_pm_standby(); break; case PM_SUSPEND_ON: @@ -335,8 +331,10 @@ static int __init at91_pm_init(void) if (cpu_is_at91rm9200()) at91_ramc_write(0, AT91RM9200_SDRAMC_LPR, 0); - if (at91_cpuidle_device.dev.platform_data) + if (at91_cpuidle_device.dev.platform_data) { + at91_pm_standby = at91_cpuidle_device.dev.platform_data; platform_device_register(&at91_cpuidle_device); + } suspend_set_ops(&at91_pm_ops);