From patchwork Sat Jun 29 08:40:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 255725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-we0-x23d.google.com (mail-we0-x23d.google.com [IPv6:2a00:1450:400c:c03::23d]) (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 1741C2C00A2 for ; Sat, 29 Jun 2013 18:41:09 +1000 (EST) Received: by mail-we0-f189.google.com with SMTP id n5sf524307wev.16 for ; Sat, 29 Jun 2013 01:41:05 -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=k0bPWIhFU2zGoaaYpGBibbXAFoRlutZCs3a2i7qY1e8=; b=Zzgk32l4nsFfuO6kIano8lo3pt6BHdLpv0IxuLjmooZedBeyfzuYKJc+B3QQPolsuJ nGuskgu8j7cjVsMabhuLgV8IjxmRF9T7rWKVtG6Hz1PG52JSpzcuUUOER3pE6ykZ3/tK PeDV2HM4GRxoyFVpTHCwv1561kqdV9gd8s8HOgLCLlXjXJC50VL2mphVfVY9LNVA2Re6 R4kQyORLHDtqnk5MwN+u3Cax05PI0AXTCrr8k+xS8PMuxM+9/uTNQoa2Bm0StU+7ZWq/ fDzlOsW0LCXEVEKTi5K6juAm4Nv7EpkMXHnl9yxIVGc1Ye7T9lnEKayfekilnE3iB4M7 scBA== X-Received: by 10.180.100.38 with SMTP id ev6mr244866wib.0.1372495264769; Sat, 29 Jun 2013 01:41:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.35.38 with SMTP id e6ls352554wij.9.canary; Sat, 29 Jun 2013 01:41:04 -0700 (PDT) X-Received: by 10.204.182.4 with SMTP id ca4mr1445616bkb.4.1372495264330; Sat, 29 Jun 2013 01:41:04 -0700 (PDT) Received: from smtp51.i.mail.ru (smtp51.i.mail.ru. [94.100.177.111]) by gmr-mx.google.com with ESMTPS id rg9si466639bkb.3.2013.06.29.01.41.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 29 Jun 2013 01:41:04 -0700 (PDT) Received-SPF: pass (google.com: domain of shc_work@mail.ru designates 94.100.177.111 as permitted sender) client-ip=94.100.177.111; Received: from [188.134.40.128] (port=44027 helo=shc.zet) by smtp51.i.mail.ru with esmtpa (envelope-from ) id 1UsqiN-0002VE-I8; Sat, 29 Jun 2013 12:41:03 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Cc: rtc-linux@googlegroups.com, Sascha Hauer , Shawn Guo , Grant Likely , Rob Herring , Alessandro Zummo , Alexander Shiyan Subject: [rtc-linux] [PATCH v3 2/5] rtc: mxc_rtc: Cleanup code Date: Sat, 29 Jun 2013 12:40:41 +0400 Message-Id: <1372495244-21215-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1372495244-21215-1-git-send-email-shc_work@mail.ru> References: <1372495244-21215-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.111 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: , This patch provide cleanup mxc_rtc driver code (spaces to tabs). No functional changes. Signed-off-by: Alexander Shiyan --- drivers/rtc/rtc-mxc.c | 52 ++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index 8ec47c8..f333581 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c @@ -20,23 +20,23 @@ #define RTC_INPUT_CLK_32000HZ (0x01 << 5) #define RTC_INPUT_CLK_38400HZ (0x02 << 5) -#define RTC_SW_BIT (1 << 0) -#define RTC_ALM_BIT (1 << 2) -#define RTC_1HZ_BIT (1 << 4) -#define RTC_2HZ_BIT (1 << 7) -#define RTC_SAM0_BIT (1 << 8) -#define RTC_SAM1_BIT (1 << 9) -#define RTC_SAM2_BIT (1 << 10) -#define RTC_SAM3_BIT (1 << 11) -#define RTC_SAM4_BIT (1 << 12) -#define RTC_SAM5_BIT (1 << 13) -#define RTC_SAM6_BIT (1 << 14) -#define RTC_SAM7_BIT (1 << 15) -#define PIT_ALL_ON (RTC_2HZ_BIT | RTC_SAM0_BIT | RTC_SAM1_BIT | \ +#define RTC_SW_BIT (1 << 0) +#define RTC_ALM_BIT (1 << 2) +#define RTC_1HZ_BIT (1 << 4) +#define RTC_2HZ_BIT (1 << 7) +#define RTC_SAM0_BIT (1 << 8) +#define RTC_SAM1_BIT (1 << 9) +#define RTC_SAM2_BIT (1 << 10) +#define RTC_SAM3_BIT (1 << 11) +#define RTC_SAM4_BIT (1 << 12) +#define RTC_SAM5_BIT (1 << 13) +#define RTC_SAM6_BIT (1 << 14) +#define RTC_SAM7_BIT (1 << 15) +#define PIT_ALL_ON (RTC_2HZ_BIT | RTC_SAM0_BIT | RTC_SAM1_BIT | \ RTC_SAM2_BIT | RTC_SAM3_BIT | RTC_SAM4_BIT | \ RTC_SAM5_BIT | RTC_SAM6_BIT | RTC_SAM7_BIT) -#define RTC_ENABLE_BIT (1 << 7) +#define RTC_ENABLE_BIT (1 << 7) #define MXC_RTC_TIME 0 #define MXC_RTC_ALARM 1 @@ -58,13 +58,13 @@ enum imx_rtc_type { }; struct rtc_plat_data { - struct rtc_device *rtc; - void __iomem *ioaddr; - int irq; + struct rtc_device *rtc; + void __iomem *ioaddr; + int irq; struct rtc_class_ops rtc_ops; struct clk *clk_rtc; struct clk *clk_ipg; - enum imx_rtc_type devtype; + enum imx_rtc_type devtype; }; /* @@ -156,7 +156,7 @@ static int rtc_update_alarm(struct device *dev, struct rtc_time *alrm) } static void mxc_rtc_irq_enable(struct device *dev, unsigned int bit, - unsigned int enabled) + unsigned int enabled) { struct platform_device *pdev = to_platform_device(dev); struct rtc_plat_data *pdata = platform_get_drvdata(pdev); @@ -187,6 +187,7 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) u32 events = 0; spin_lock_irqsave(&pdata->rtc->irq_lock, flags); + status = readw(ioaddr + RTC_RTCISR) & readw(ioaddr + RTC_RTCIENR); /* clear interrupt sources */ writew(status, ioaddr + RTC_RTCISR); @@ -205,6 +206,7 @@ static irqreturn_t mxc_rtc_interrupt(int irq, void *dev_id) events |= (RTC_PF | RTC_IRQF); rtc_update_irq(pdata->rtc, 1, events); + spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags); return IRQ_HANDLED; @@ -454,14 +456,14 @@ static const struct platform_device_id mxc_rtc_id_table[] = { MODULE_DEVICE_TABLE(platform, mxc_rtc_id_table); static struct platform_driver mxc_rtc_driver = { - .driver = { - .name = "mxc_rtc", - .pm = &mxc_rtc_pm_ops, - .owner = THIS_MODULE, + .driver = { + .name = "mxc_rtc", + .owner = THIS_MODULE, + .pm = &mxc_rtc_pm_ops, }, .id_table = mxc_rtc_id_table, - .probe = mxc_rtc_probe, - .remove = mxc_rtc_remove, + .probe = mxc_rtc_probe, + .remove = mxc_rtc_remove, }; module_platform_driver(mxc_rtc_driver)