From patchwork Tue Jun 22 09:54:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wan ZongShun X-Patchwork-Id: 56446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pz0-f56.google.com (mail-pz0-f56.google.com [209.85.210.56]) by ozlabs.org (Postfix) with ESMTP id 9934FB6EF0 for ; Tue, 22 Jun 2010 19:54:59 +1000 (EST) Received: by pzk1 with SMTP id 1sf201063pzk.11 for ; Tue, 22 Jun 2010 02:54:57 -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=VNYDJH6ALPTseJ5fgM2FVzaQohbDNXdSU9c2BDO9V9M=; b=KgnMvBB/EuHGGi5Mo5MT8/U6f0hGxSY+RPJPGkR49dTvTcKzLlj5Qbsss+fEyvoso9 T97hA17spNYVUJG1jqkHdYIJ4Qg1GW6TVA8XyaVeoJMC4WmnRVmRE/2FUyZHVd2hfCpZ afQCVV2ds3UvP/+UH6DMjvdI5KAC9LLNGtS/M= 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=Lj/BrCxsSvfNAn7OpwGJsz8pfQ9RETPXbAiBnNThMGpqu7NzoZJbZ/XJAWWJRvgOLi 6fuHvZrLVp7ftM2Ky77yMVHCDjfJeRV2EGIl8YvWBUUxTJM/FhTFgwjW18Any3NIFQh9 N+amlEMum/tI/Yp+IOkvSt8+bqyXed4woEPIY= Received: by 10.115.100.10 with SMTP id c10mr467765wam.4.1277200497565; Tue, 22 Jun 2010 02:54:57 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.115.38.17 with SMTP id q17ls3206293waj.0.p; Tue, 22 Jun 2010 02:54:57 -0700 (PDT) Received: by 10.114.31.12 with SMTP id e12mr1058443wae.44.1277200497069; Tue, 22 Jun 2010 02:54:57 -0700 (PDT) Received: by 10.114.31.12 with SMTP id e12mr1058442wae.44.1277200496698; Tue, 22 Jun 2010 02:54:56 -0700 (PDT) Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by gmr-mx.google.com with ESMTP id u10si29768756wak.6.2010.06.22.02.54.55; Tue, 22 Jun 2010 02:54:55 -0700 (PDT) Received-SPF: pass (google.com: domain of mcuos.com@gmail.com designates 209.85.160.44 as permitted sender) client-ip=209.85.160.44; Received: by pwi6 with SMTP id 6so1764287pwi.3 for ; Tue, 22 Jun 2010 02:54:55 -0700 (PDT) Received: by 10.115.84.8 with SMTP id m8mr5359777wal.9.1277200495242; Tue, 22 Jun 2010 02:54:55 -0700 (PDT) Received: from [192.168.1.10] ([116.226.201.224]) by mx.google.com with ESMTPS id c1sm55857042wam.7.2010.06.22.02.54.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 02:54:54 -0700 (PDT) Message-ID: <4C208865.5090002@gmail.com> Date: Tue, 22 Jun 2010 17:54:45 +0800 From: Wan ZongShun User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Alessandro Zummo , Andrew Morton , LKML , rtc-linux Subject: [rtc-linux] [PATCH] RTC/m48t86: patch for use rtc_valid_tm to check returning tm. 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.160.44 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 use rtc_valid_tm for checking returning struct rtc_time *tm, it can avoid returning wrong tm value. Signed-off-by: Wan ZongShun --- drivers/rtc/rtc-m48t86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-m48t86.c b/drivers/rtc/rtc-m48t86.c index 7c045cf..f981287 100644 --- a/drivers/rtc/rtc-m48t86.c +++ b/drivers/rtc/rtc-m48t86.c @@ -77,7 +77,7 @@ static int m48t86_rtc_read_time(struct device *dev, struct rtc_time *tm) if (ops->readbyte(M48T86_REG_HOUR) & 0x80) tm->tm_hour += 12; - return 0; + return rtc_valid_tm(tm); } static int m48t86_rtc_set_time(struct device *dev, struct rtc_time *tm)