From patchwork Mon Jan 3 07:49:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 446931 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 p037oN1m001585 for ; Mon, 3 Jan 2011 07:50:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752982Ab1ACHuY (ORCPT ); Mon, 3 Jan 2011 02:50:24 -0500 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:41193 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635Ab1ACHuX (ORCPT ); Mon, 3 Jan 2011 02:50:23 -0500 Received: from source ([209.85.215.169]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKTSF/v7MugtOz7Ecg+mKL92ZhvwaKbX5Q@postini.com; Sun, 02 Jan 2011 23:50:23 PST Received: by eyh6 with SMTP id 6so2785644eyh.0 for ; Sun, 02 Jan 2011 23:50:22 -0800 (PST) Received: by 10.213.104.136 with SMTP id p8mr15136400ebo.59.1294041021873; Sun, 02 Jan 2011 23:50:21 -0800 (PST) Received: from localhost (cs181221087.pp.htv.fi [82.181.221.87]) by mx.google.com with ESMTPS id t50sm14558660eeh.18.2011.01.02.23.50.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 Jan 2011 23:50:21 -0800 (PST) From: Felipe Balbi To: Tony Lindgren Cc: Linux OMAP Mailing List , Felipe Balbi Subject: [RFT/PATCH 09/10] cbus: retu-rtc: drop the reset_occurred flag Date: Mon, 3 Jan 2011 09:49:47 +0200 Message-Id: <1294040988-21191-10-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.3.4.598.g85356 In-Reply-To: <1294040988-21191-1-git-send-email-balbi@ti.com> References: <1294040988-21191-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.3 (demeter1.kernel.org [140.211.167.41]); Mon, 03 Jan 2011 07:50:25 +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)) {