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: 3214741 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E3B11C045B for ; Wed, 20 Nov 2013 18:22:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEB2B20452 for ; Wed, 20 Nov 2013 18:22:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AFDD020253 for ; Wed, 20 Nov 2013 18:22:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753729Ab3KTSVu (ORCPT ); Wed, 20 Nov 2013 13:21:50 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]:35907 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754537Ab3KTSVq (ORCPT ); Wed, 20 Nov 2013 13:21:46 -0500 Received: by mail-pb0-f45.google.com with SMTP id rp16so3873081pbb.4 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=ERniyVTh5wgD6k+GDHnKv6eMGjOx5ejydzoidNfByEqMAf5PZzEZsKSvUCK3i4/3WP EWGS2JOwvfteY4LF83hMuN0BmSebHMXuySprr8Wtx1+8T+2Sc1+xSqg+c9u4bexIOuXe Rlmp7rmkrLpqKIM8r42fPLWr3NGWQERmS0xx3Nu6cUxz5T561MRpL1ylCTnfaExgS/JX 8Iazs2Zc8fw1tDR+YU9Rh30q19W7RxdBAOiUj6sbBIvtaXomOuEZoReymbO74KMCkise aChdZBvEUfE6beDcS68VNj8xCAdS7WO/d9qz1eR/Ilxvj7EHRmHdQe0Y93fw4Z9M0Zjh IlTw== X-Gm-Message-State: ALoCoQkofiYaQdhMHYGW2p4YB55ZSmMoNJ7V7il1vDxV+AhUfRc45wEhy0ryW5zxqQ5+fO+AjN19 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 Cc: Tomasz Figa , Heiko Stuebner , Amit Daniel Kachhap , Abhilash Kesavan , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Doug Andersen , Daniel Kurtz 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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);