From patchwork Wed Nov 20 18:21:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kurtz X-Patchwork-Id: 3214791 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 170199F26C for ; Wed, 20 Nov 2013 18:23:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D11A20782 for ; Wed, 20 Nov 2013 18:23:43 +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 2058C20780 for ; Wed, 20 Nov 2013 18:23:42 +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 1VjCQD-0001CO-E7; Wed, 20 Nov 2013 18:22:41 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VjCPw-0001o7-9x; Wed, 20 Nov 2013 18:22:24 +0000 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VjCPi-0001jl-Mv for linux-arm-kernel@lists.infradead.org; Wed, 20 Nov 2013 18:22:12 +0000 Received: by mail-pb0-f47.google.com with SMTP id um1so3837962pbc.6 for ; Wed, 20 Nov 2013 10:21:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XlLCLMpjZFQ08klkDX+WWF27R0JDWsC9mQV9HeTDbZo=; b=QQD3SRnN0aee00fMo66Cqygf7FgcPTa7ecjIHH80q5ygoK8sp8H9O+/JgFPQ+8UmcR YXu2jN/Z4N5v+0xBY41TJyuBfuaX5Sh/ENRjSmGKT+aPQbaHAH9NF81sqEE4l4KKUCfo VH3NsrUf6HzHERAInNEwPz5vcj9+iVpJQplFs= 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=XlLCLMpjZFQ08klkDX+WWF27R0JDWsC9mQV9HeTDbZo=; b=Wox7/1iUHeAqKmWTyu608xc1f1c2jfmcr1hdteK3zGCx3w2OJXj6vpNJA7wWLasaju hpoOwQIo0uwUrw2OoqLIESjxunYkrv4a8GzPTmfWSG0OmQqwt3Jqo46CAu90ojiZB9G1 iCbmuEt9/hrL7sJi8Ph9g+6UECfo6q4sIxAKbtC7TUSswS8f7b/oWBy42DWEuLQuC54Y PDWdJAnm6Cro1YW6l9JcsKcpmmIGQRlme+ed2MURv1OrvDlhLf0sVoJcc/ufaovJ5c7E gdUzMP2YpZBkgMegKZOpwI6mNk4kJ88S8NEBXaYX5C/8fVgsrtyQ0lllVBTv+Iseb1X8 8TXA== X-Gm-Message-State: ALoCoQlDogULKtbqg3ph34IoupDwvBnK/Ou9fh1WidtMAreYOlStnm8stMqGwnbNuvNCr8n2BhdB X-Received: by 10.68.189.197 with SMTP id gk5mr2056311pbc.37.1384971705627; Wed, 20 Nov 2013 10:21:45 -0800 (PST) Received: from djkurtzt530-glaptop.corp.google.com ([172.30.22.19]) by mx.google.com with ESMTPSA id sg1sm39519561pbb.16.2013.11.20.10.21.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Nov 2013 10:21:44 -0800 (PST) From: Daniel Kurtz To: Russell King , Kukjin Kim , Ben Dooks Subject: [PATCH 2/3] ARM: SAMSUNG: Let s3c_pm_do_restore_*() take const sleep_save Date: Thu, 21 Nov 2013 02:21:25 +0800 Message-Id: <1384971686-7208-2-git-send-email-djkurtz@chromium.org> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1384971686-7208-1-git-send-email-djkurtz@chromium.org> References: <1384971686-7208-1-git-send-email-djkurtz@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131120_132210_883193_8CD9F1FB X-CRM114-Status: GOOD ( 11.95 ) X-Spam-Score: -2.0 (--) Cc: linux-samsung-soc@vger.kernel.org, Heiko Stuebner , Tomasz Figa , linux-kernel@vger.kernel.org, Daniel Kurtz , Doug Andersen , Amit Daniel Kachhap , Abhilash Kesavan , 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.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 restore functions do not modify the passed in struct sleep_save, so that parameter can be const. This allows us to pass in const struct. This allows us to use const structs sleep_save to define system registers that will always be restored to a constant value. Signed-off-by: Daniel Kurtz Reviewed-by: Tomasz Figa --- arch/arm/plat-samsung/include/plat/pm.h | 4 ++-- arch/arm/plat-samsung/pm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h index 6bc1a8f..ff6063f 100644 --- a/arch/arm/plat-samsung/include/plat/pm.h +++ b/arch/arm/plat-samsung/include/plat/pm.h @@ -101,8 +101,8 @@ struct pm_uart_save { /* helper functions to save/restore lists of registers. */ extern void s3c_pm_do_save(struct sleep_save *ptr, int count); -extern void s3c_pm_do_restore(struct sleep_save *ptr, int count); -extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); +extern void s3c_pm_do_restore(const struct sleep_save *ptr, int count); +extern void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count); #ifdef CONFIG_SAMSUNG_PM extern int s3c_irq_wake(struct irq_data *data, unsigned int state); diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c index d0c2301..416e5be 100644 --- a/arch/arm/plat-samsung/pm.c +++ b/arch/arm/plat-samsung/pm.c @@ -182,7 +182,7 @@ void s3c_pm_do_save(struct sleep_save *ptr, int count) * restore the UARTs state yet */ -void s3c_pm_do_restore(struct sleep_save *ptr, int count) +void s3c_pm_do_restore(const struct sleep_save *ptr, int count) { for (; count > 0; count--, ptr++) { printk(KERN_DEBUG "restore %p (restore %08lx, was %08x)\n", @@ -203,7 +203,7 @@ void s3c_pm_do_restore(struct sleep_save *ptr, int count) * peripherals, as things may be changing! */ -void s3c_pm_do_restore_core(struct sleep_save *ptr, int count) +void s3c_pm_do_restore_core(const struct sleep_save *ptr, int count) { for (; count > 0; count--, ptr++) __raw_writel(ptr->val, ptr->reg);