From patchwork Tue Jul 2 16:50:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 256464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-fa0-x23e.google.com (mail-fa0-x23e.google.com [IPv6:2a00:1450:4001:c02::23e]) (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 3A8AF2C013D for ; Wed, 3 Jul 2013 02:50:16 +1000 (EST) Received: by mail-fa0-f62.google.com with SMTP id m1sf1329876fae.7 for ; Tue, 02 Jul 2013 09:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:x-beenthere:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references:x-spam:x-mras: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=wAcHfwvADxEsM641INbMRn+efXXAyCubu4tOYhvu/ko=; b=Foj6YDAwPI4d6G+AZ/4InndpIHb29+c6uoCRfzrKXVk/ncoWyjP0jvVjMMfedH9aCO IFPd0ys02qNCbYPNixqNaVnLmVPETDlJ71Z57HK/aydHwSTRKB59qniokp2iCoHHyYLp uTLAsIqig5jkRPMCpz1GRAvR9JVTHE6H83WOKt72CTm4tGUMRDmpX3dttSb6LD8vbdGx 5iKua0DJXYk7gFjc/exczbAACQeoVXRMV31sB/sytCgs730IPP1L+3GrdbCiDgFzYcev ttp83LNQwu5WirCfvGTguSsyDO8HD/9SPeM46UMqs9SdajsNFQTxR0xtgtTng7qZ43Zn Jyuw== X-Received: by 10.180.207.47 with SMTP id lt15mr755002wic.0.1372783812697; Tue, 02 Jul 2013 09:50:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.185.168 with SMTP id fd8ls1058716wic.7.canary; Tue, 02 Jul 2013 09:50:12 -0700 (PDT) X-Received: by 10.204.230.12 with SMTP id jk12mr2910348bkb.8.1372783812064; Tue, 02 Jul 2013 09:50:12 -0700 (PDT) Received: from smtp38.i.mail.ru (smtp38.i.mail.ru. [94.100.177.98]) by gmr-mx.google.com with ESMTPS id b9si1196322bkc.1.2013.07.02.09.50.11 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Jul 2013 09:50:12 -0700 (PDT) Received-SPF: pass (google.com: domain of shc_work@mail.ru designates 94.100.177.98 as permitted sender) client-ip=94.100.177.98; Received: from [188.134.40.128] (port=15142 helo=shc.zet) by smtp38.i.mail.ru with esmtpa (envelope-from ) id 1Uu3mN-0006Yk-BX; Tue, 02 Jul 2013 20:50:11 +0400 From: Alexander Shiyan To: rtc-linux@googlegroups.com Cc: linux-kernel@vger.kernel.org, Alessandro Zummo , Alexander Shiyan Subject: [rtc-linux] [PATCH 3/3] rtc: ds1742: Report to RTC core if retrieved time is invalid Date: Tue, 2 Jul 2013 20:50:02 +0400 Message-Id: <1372783802-6569-3-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1372783802-6569-1-git-send-email-shc_work@mail.ru> References: <1372783802-6569-1-git-send-email-shc_work@mail.ru> X-Spam: Not detected X-Mras: Ok X-Original-Sender: shc_work@mail.ru X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of shc_work@mail.ru designates 94.100.177.98 as permitted sender) smtp.mail=shc_work@mail.ru; dkim=pass header.i=@mail.ru 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: , Signed-off-by: Alexander Shiyan --- drivers/rtc/rtc-ds1742.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c index 139934f..17b73fd 100644 --- a/drivers/rtc/rtc-ds1742.c +++ b/drivers/rtc/rtc-ds1742.c @@ -115,11 +115,7 @@ static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm) /* year is 1900 + tm->tm_year */ tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900; - if (rtc_valid_tm(tm) < 0) { - dev_err(dev, "retrieved date/time is not valid.\n"); - rtc_time_to_tm(0, tm); - } - return 0; + return rtc_valid_tm(tm); } static const struct rtc_class_ops ds1742_rtc_ops = {