From patchwork Thu Nov 8 12:41:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Song X-Patchwork-Id: 197834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-vc0-f184.google.com (mail-vc0-f184.google.com [209.85.220.184]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 2FA692C00A4 for ; Thu, 8 Nov 2012 23:42:51 +1100 (EST) Received: by mail-vc0-f184.google.com with SMTP id p16sf2011653vcq.11 for ; Thu, 08 Nov 2012 04:42:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:x-beenthere:received-spf:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references:x-originalarrivaltime :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=f9F7pX3/rWPTrFhCD1Hb9iLhmHfW8iVX9Dp7no6fSq4=; b=LiTbmney2ZnxYAN/xVnARd5+CfNd3BmuM8lQaUOWGV3muS+JIhd/mJmRCeMqJX59v/ RX9BqHydLLncUXdloabgX03OAcC90oyCfG6F8SvWonKLGJW9qNpBEgpbUof/0ndvhCjL dLxLcEuqdOiF5ZWkh1qQj82/cSygHVpIpngdQa7INQWUfD7iwPi2VIGO5dlg2unMKfYN 5fdfqdZZRlnlmjpBOW8ml9bEp+GAuYXBjZUHeQvCZwBcC0EQjR0fwbTe6yhik68DMWNL Bwa828nrdWIQn8EuBmu6WxTc6/vrZD2P75w2pvOhyBtFSx7cRdc5/a2MxtVoZvD8C7Wm 8Jhg== Received: by 10.68.189.37 with SMTP id gf5mr2601452pbc.16.1352378568470; Thu, 08 Nov 2012 04:42:48 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.68.141.79 with SMTP id rm15ls11103485pbb.1.gmail; Thu, 08 Nov 2012 04:42:48 -0800 (PST) Received: by 10.66.86.102 with SMTP id o6mr2956861paz.41.1352378568246; Thu, 08 Nov 2012 04:42:48 -0800 (PST) Received: by 10.66.86.102 with SMTP id o6mr2956860paz.41.1352378568233; Thu, 08 Nov 2012 04:42:48 -0800 (PST) Received: from na3sys009aog111.obsmtp.com (na3sys009aog111.obsmtp.com [74.125.149.205]) by gmr-mx.google.com with SMTP id js4si6127156pbb.2.2012.11.08.04.42.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Nov 2012 04:42:48 -0800 (PST) Received-SPF: neutral (google.com: 74.125.149.205 is neither permitted nor denied by best guess record for domain of liangs@marvell.com) client-ip=74.125.149.205; Received: from MSI-MTA.marvell.com ([65.219.4.132]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKUJuovwUUm4tc7hZUShG/SicarZHOiurn@postini.com; Thu, 08 Nov 2012 04:42:48 PST Received: from maili.marvell.com ([10.68.76.210]) by MSI-MTA.marvell.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Nov 2012 04:41:58 -0800 Received: from localhost (unknown [10.38.34.184]) by maili.marvell.com (Postfix) with ESMTP id 1A40D4E513; Thu, 8 Nov 2012 04:41:58 -0800 (PST) From: Leo Song To: Alessandro Zummo , Cc: Leo Song , Yi Zhang Subject: [rtc-linux] [PATCH 2/2] rtc: sa1100: add 2038 year constraint for set_time Date: Thu, 8 Nov 2012 20:41:34 +0800 Message-Id: <1352378494-23942-2-git-send-email-liangs@marvell.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1352378494-23942-1-git-send-email-liangs@marvell.com> References: <1352378494-23942-1-git-send-email-liangs@marvell.com> X-OriginalArrivalTime: 08 Nov 2012 12:41:58.0204 (UTC) FILETIME=[7109CFC0:01CDBDAE] X-Original-Sender: liangs@marvell.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 74.125.149.205 is neither permitted nor denied by best guess record for domain of liangs@marvell.com) smtp.mail=liangs@marvell.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , From: Yi Zhang Change-Id: I77780c9f7143b0a6522d4f9092d1fc53d03ee3e1 Signed-off-by: Yi Zhang --- drivers/rtc/rtc-sa1100.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index 25ac904..54a7b65 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -126,9 +127,14 @@ static int sa1100_rtc_set_time(struct device *dev, struct rtc_time *tm) unsigned long time; int ret; + if (tm->tm_year > 138) + return -EINVAL; + ret = rtc_tm_to_time(tm, &time); if (ret == 0) RCNR = time; + + udelay(200); return ret; }