From patchwork Tue Jun 22 09:41:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wan ZongShun X-Patchwork-Id: 56445 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 15AF1B6F10 for ; Tue, 22 Jun 2010 19:53:27 +1000 (EST) Received: by pwi5 with SMTP id 5sf995662pwi.11 for ; Tue, 22 Jun 2010 02:53:22 -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:cc: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=t4NmIyWxB2UN0V/YrxIK6tp0O/N06xuqXIZLUWwLe1M=; b=VCUdDIa+p+hHx2W9ZxhQq9izj9CFZQUkCJmX+lphgMNVp9rGCjIa0LF54imCjIzhG6 Efo+hBk540fTM4xhy42vC2XLVXvXNpy8E8GJenEtwwf8or1zz6qwTCRHf/HSeIF3AhCQ XW+pHBJ+gmhtTQrtov7sV/V/LmC/U6JXor4qQ= 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:cc: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=j4CvGYV4Wci8wRGQMVuQT/dbkL9fk4jLnk3UW28iK0w9XiWsa2j4o+O19JnNLjxDy0 ZA2YXhCqwWaPCTIuqxq6ZN9xNd21FBJgoZqu0uFztSOhb+R3wVeou4L6uEMzQJk5hxPr VXHZRJwW5xgd8yR+UOLWdPJQLvtjdDicDD9Ps= Received: by 10.115.81.27 with SMTP id i27mr475200wal.2.1277199699786; Tue, 22 Jun 2010 02:41:39 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.115.103.33 with SMTP id f33ls3173456wam.3.p; Tue, 22 Jun 2010 02:41:39 -0700 (PDT) Received: by 10.114.248.3 with SMTP id v3mr1057613wah.12.1277199699218; Tue, 22 Jun 2010 02:41:39 -0700 (PDT) Received: by 10.114.248.3 with SMTP id v3mr1057612wah.12.1277199699186; Tue, 22 Jun 2010 02:41:39 -0700 (PDT) Received: from mail-pw0-f43.google.com (mail-pw0-f43.google.com [209.85.160.43]) by gmr-mx.google.com with ESMTP id e19si29748181wam.4.2010.06.22.02.41.38; Tue, 22 Jun 2010 02:41:38 -0700 (PDT) Received-SPF: pass (google.com: domain of mcuos.com@gmail.com designates 209.85.160.43 as permitted sender) client-ip=209.85.160.43; Received: by pwi8 with SMTP id 8so179975pwi.30 for ; Tue, 22 Jun 2010 02:41:38 -0700 (PDT) Received: by 10.115.36.31 with SMTP id o31mr5328037waj.79.1277199696410; Tue, 22 Jun 2010 02:41:36 -0700 (PDT) Received: from [192.168.1.10] ([116.226.201.224]) by mx.google.com with ESMTPS id n29sm18763970wae.4.2010.06.22.02.41.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 02:41:35 -0700 (PDT) Message-ID: <4C208545.7030604@gmail.com> Date: Tue, 22 Jun 2010 17:41:25 +0800 From: Wan ZongShun User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: Alessandro Zummo CC: Andrew Morton , rtc-linux , LKML Subject: [rtc-linux] [PATCH] RTC/m48t59: use rtc_valid_tm to check returning tm for m48t59 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.43 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-m48t59.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c index be8359f..447f90f 100644 --- a/drivers/rtc/rtc-m48t59.c +++ b/drivers/rtc/rtc-m48t59.c @@ -105,7 +105,7 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm) dev_dbg(dev, "RTC read time %04d-%02d-%02d %02d/%02d/%02d\n", tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); - return 0; + return rtc_valid_tm(tm); } static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm) @@ -196,7 +196,7 @@ static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) dev_dbg(dev, "RTC read alarm time %04d-%02d-%02d %02d/%02d/%02d\n", tm->tm_year + 1900, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); - return 0; + return rtc_valid_tm(tm); } /*