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: 21021 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BC11F20D9F for ; Tue, 15 Oct 2013 07:50:53 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id uy5sf30412454obc.0 for ; Tue, 15 Oct 2013 00:50:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=5lS3swrBb5r5y3Xzs9ecj9gsO5y9/l3MaxrhBe8itQw=; b=h5vbhWnVvj59X7K2mSwAKiXqMn7BquMBoLfR6hcwxU9Zl7l86M1TlL14X+nQmEiIJr f9zgc2qkdZ1Q1nF8qoRVh0ydvhOwPzb+d4QXv/jDj0WsQbB5Cjn3lYn5Judztg5lpTYR SmEMYPum+HmZoehsaFtiSqaIJZcGNoBQLUmrdeGupLtuLegGzl4Mijw+BSmlIJtGAA8J YhU648uCio8LYCUBKo/kx7hX7N6jZqAsfOMVf+yDhp8QHiUjI7EITZsBnyiBn3lxEhQD YUQwjige8/MG9RW7/XMinnTc+1h58D+j5o8crgofyvVKYw+o86Zja5AkH4c+GV0vBoxT 1tdg== X-Received: by 10.43.65.81 with SMTP id xl17mr3034543icb.29.1381823453371; Tue, 15 Oct 2013 00:50:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.177 with SMTP id gf17ls17246qeb.4.gmail; Tue, 15 Oct 2013 00:50:53 -0700 (PDT) X-Received: by 10.220.237.208 with SMTP id kp16mr38647456vcb.4.1381823453173; Tue, 15 Oct 2013 00:50:53 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id ph5si2856281veb.90.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 00:50:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ib11so5195751vcb.0 for ; Tue, 15 Oct 2013 00:50:53 -0700 (PDT) X-Gm-Message-State: ALoCoQk3WJcqjRzGHv3jSLFP7snPj9QWQCvEJnnh6zQmOz6dMraYdf8f3eh5OPVzwmX6cjyT8uy7 X-Received: by 10.52.26.69 with SMTP id j5mr499775vdg.21.1381823453098; Tue, 15 Oct 2013 00:50:53 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp279890vcz; Tue, 15 Oct 2013 00:50:52 -0700 (PDT) X-Received: by 10.194.201.202 with SMTP id kc10mr33034488wjc.1.1381823452189; Tue, 15 Oct 2013 00:50:52 -0700 (PDT) Received: from mail-we0-f180.google.com (mail-we0-f180.google.com [74.125.82.180]) by mx.google.com with ESMTPS id jr6si26503599wjc.99.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 00:50:52 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.180 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.180; Received: by mail-we0-f180.google.com with SMTP id q59so7946770wes.25 for ; Tue, 15 Oct 2013 00:50:51 -0700 (PDT) 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 Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, thomas.petazzoni@free-electrons.com, b.zolnierkie@samsung.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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.lezcano@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);