From patchwork Thu Jun 24 08:41:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wan ZongShun X-Patchwork-Id: 56769 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pw0-f56.google.com (mail-pw0-f56.google.com [209.85.160.56]) by ozlabs.org (Postfix) with ESMTP id 465C7B6F0E for ; Thu, 24 Jun 2010 18:42:07 +1000 (EST) Received: by pwi5 with SMTP id 5sf1607834pwi.11 for ; Thu, 24 Jun 2010 01:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:received:received:message-id:date :from:user-agent:mime-version:to:subject:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=phoF+FvQwnM+auFXPrW86n1+tCGFTx7RnJb1pixx26s=; b=l9Rvm43DD3DFS90he/MakMDo2+URYduy4zLR84kY6ljbvhO4oVMZhRMSsbBrrEE9qL ssrW3wfcFkPs5AU9ojxcUyEjUkKpEVLHXnl3k7i+s80x0tShCUvZlVxy/cybvrFDZdJk gatksaUqMCKQKW6by1qN663yO6pS3J2ZVO1b0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:message-id:date:from:user-agent :mime-version:to:subject:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; b=3kOCb+hFeBcNFAY2+dkgT7xeg6+JG0hijJuvKIinjJTGraQ+wI+eS3ZxNGOhNzYcze t5SOi5NlvRqIaR3AvPBCmAO1PXr9IHVjlmauwVhY7O341uXNTn6jAvqSuOuo9JhoIEey 9YIgtPV4YMR3/MUc8h90fg+imbxhjb2lflZ+E= Received: by 10.115.98.13 with SMTP id a13mr770615wam.0.1277368925784; Thu, 24 Jun 2010 01:42:05 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.115.38.17 with SMTP id q17ls5021245waj.0.p; Thu, 24 Jun 2010 01:42:05 -0700 (PDT) Received: by 10.115.39.24 with SMTP id r24mr1803771waj.19.1277368925169; Thu, 24 Jun 2010 01:42:05 -0700 (PDT) Received: by 10.115.39.24 with SMTP id r24mr1803770waj.19.1277368925146; Thu, 24 Jun 2010 01:42:05 -0700 (PDT) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by gmr-mx.google.com with ESMTP id u10si31920505wak.6.2010.06.24.01.42.03; Thu, 24 Jun 2010 01:42:04 -0700 (PDT) Received-SPF: pass (google.com: domain of mcuos.com@gmail.com designates 209.85.212.182 as permitted sender) client-ip=209.85.212.182; Received: by pxi11 with SMTP id 11so278518pxi.41 for ; Thu, 24 Jun 2010 01:42:03 -0700 (PDT) Received: by 10.143.154.28 with SMTP id g28mr8573430wfo.70.1277368923746; Thu, 24 Jun 2010 01:42:03 -0700 (PDT) Received: from [192.168.1.10] ([116.226.201.224]) by mx.google.com with ESMTPS id f20sm5927188rvb.3.2010.06.24.01.41.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 24 Jun 2010 01:42:02 -0700 (PDT) Message-ID: <4C231A40.20401@gmail.com> Date: Thu, 24 Jun 2010 16:41:36 +0800 From: Wan ZongShun User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Andrew Morton , LKML , rtc-linux , Alessandro Zummo Subject: [rtc-linux] [PATCH 1/3] RTC/nuc900: make returning time checking function valid X-Original-Sender: mcuos.com@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of mcuos.com@gmail.com designates 209.85.212.182 as permitted sender) smtp.mail=mcuos.com@gmail.com; dkim=pass (test mode) header.i=@gmail.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , This patch is to make returning time checking function valid. In spite of using the 'rtc_valid_tm', nevertheless, the read time function omits its returning value, that means the 'rtc_valid_tm' is useless here. Signed-off-by: Wan ZongShun --- drivers/rtc/rtc-nuc900.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/rtc/rtc-nuc900.c b/drivers/rtc/rtc-nuc900.c index 20bc70b..84336d1 100644 --- a/drivers/rtc/rtc-nuc900.c +++ b/drivers/rtc/rtc-nuc900.c @@ -102,7 +102,7 @@ static int *check_rtc_access_enable(struct nuc900_rtc *nuc900_rtc) return 0; } -static void nuc900_rtc_bcd2bin(unsigned int timereg, +static int nuc900_rtc_bcd2bin(unsigned int timereg, unsigned int calreg, struct rtc_time *tm) { tm->tm_mday = bcd2bin(calreg >> 0); @@ -113,7 +113,7 @@ static void nuc900_rtc_bcd2bin(unsigned int timereg, tm->tm_min = bcd2bin(timereg >> 8); tm->tm_hour = bcd2bin(timereg >> 16); - rtc_valid_tm(tm); + return rtc_valid_tm(tm); } static void nuc900_rtc_bin2bcd(struct device *dev, struct rtc_time *settm, @@ -170,9 +170,7 @@ static int nuc900_rtc_read_time(struct device *dev, struct rtc_time *tm) timeval = __raw_readl(rtc->rtc_reg + REG_RTC_TLR); clrval = __raw_readl(rtc->rtc_reg + REG_RTC_CLR); - nuc900_rtc_bcd2bin(timeval, clrval, tm); - - return 0; + return nuc900_rtc_bcd2bin(timeval, clrval, tm); } static int nuc900_rtc_set_time(struct device *dev, struct rtc_time *tm) @@ -205,9 +203,7 @@ static int nuc900_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) timeval = __raw_readl(rtc->rtc_reg + REG_RTC_TAR); carval = __raw_readl(rtc->rtc_reg + REG_RTC_CAR); - nuc900_rtc_bcd2bin(timeval, carval, &alrm->time); - - return 0; + return nuc900_rtc_bcd2bin(timeval, carval, &alrm->time); } static int nuc900_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)