From patchwork Thu Feb 3 10:20:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 529031 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p13ALPMv011814 for ; Thu, 3 Feb 2011 10:21:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756181Ab1BCKVK (ORCPT ); Thu, 3 Feb 2011 05:21:10 -0500 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:53381 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756152Ab1BCKVI (ORCPT ); Thu, 3 Feb 2011 05:21:08 -0500 Received: from source ([209.85.161.44]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTUqBk6W9ceqVVBmXk0cWXp72LVpFljZJ@postini.com; Thu, 03 Feb 2011 02:21:08 PST Received: by mail-fx0-f44.google.com with SMTP id 9so1038492fxm.17 for ; Thu, 03 Feb 2011 02:21:07 -0800 (PST) Received: by 10.223.79.6 with SMTP id n6mr913266fak.122.1296728467394; Thu, 03 Feb 2011 02:21:07 -0800 (PST) Received: from localhost (cs181221087.pp.htv.fi [82.181.221.87]) by mx.google.com with ESMTPS id j12sm196287fax.9.2011.02.03.02.21.05 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 03 Feb 2011 02:21:06 -0800 (PST) From: Felipe Balbi To: Tony Lindgren Cc: Linux OMAP Mailing List , Felipe Balbi Subject: [RFT/RFC/PATCH 11/13] cbus: retu-rtc: drop the reset_occurred flag Date: Thu, 3 Feb 2011 12:20:26 +0200 Message-Id: <1296728428-26399-12-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.4.rc2 In-Reply-To: <1296728428-26399-1-git-send-email-balbi@ti.com> References: <1296728428-26399-1-git-send-email-balbi@ti.com> Organization: Texas Instruments\n Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 03 Feb 2011 10:21:27 +0000 (UTC) diff --git a/drivers/cbus/retu-rtc.c b/drivers/cbus/retu-rtc.c index 6e201aa..b2b9472 100644 --- a/drivers/cbus/retu-rtc.c +++ b/drivers/cbus/retu-rtc.c @@ -52,7 +52,6 @@ struct retu_rtc { struct rtc_device *rtc; u16 alarm_expired; - u16 reset_occurred; }; static void retu_rtc_do_reset(struct retu_rtc *rtc) @@ -71,7 +70,6 @@ static void retu_rtc_do_reset(struct retu_rtc *rtc) retu_write_reg(RETU_REG_RTCCALR, 0x00c0); rtc->alarm_expired = 0; - rtc->reset_occurred = 1; } static irqreturn_t retu_rtc_interrupt(int irq, void *_rtc) @@ -223,14 +221,10 @@ static int __init retu_rtc_probe(struct platform_device *pdev) goto err1; } - /* If the calibration register is zero, we've probably lost - * power */ - if (retu_read_reg(RETU_REG_RTCCALR) & 0x00ff) - rtc->reset_occurred = 0; - else + /* If the calibration register is zero, we've probably lost power */ + if (!(retu_read_reg(RETU_REG_RTCCALR) & 0x00ff)) retu_rtc_do_reset(rtc); - rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, & retu_rtc_ops, THIS_MODULE); if (IS_ERR(rtc->rtc)) {