From patchwork Mon Feb 23 14:53:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 23561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from yw-out-2122.google.com (yw-out-2122.google.com [74.125.46.24]) by ozlabs.org (Postfix) with ESMTP id 2D496DDEF0 for ; Tue, 24 Feb 2009 01:53:28 +1100 (EST) Received: by yw-out-2122.google.com with SMTP id 4so1391025ywc.11 for ; Mon, 23 Feb 2009 06:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received-spf:authentication-results:received :received:received:received:x-authentication-warning:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references:x-antiabuse :x-antiabuse:x-antiabuse:x-antiabuse:x-antiabuse:x-source :x-source-args:x-source-dir:reply-to:sender:precedence:x-google-loop :mailing-list:list-id:list-post:list-help:list-unsubscribe :x-beenthere-env:x-beenthere; bh=YPfecvaru86JN8k+lhObBb6H5UT/J2zBtgq7XH17b7E=; b=otitRh9+WOhApBNBRdiCEmQHkBWLgwxPCg2KycYGZ69KxsQ+O0wfjFH/0vZoVNN2dw 3miSTzCKGg6K7gZXzBqHUytXYlc/KHtj6/3soeuo2M4o+Iq/TUO3eLpXzcGCZmAwsrSt hnnvRMJG3UShF4xTYeJCop/J4ZRBoQLhSQfKk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results :x-authentication-warning:from:to:cc:subject:date:message-id :x-mailer:in-reply-to:references:x-antiabuse:x-source:x-source-args :x-source-dir:reply-to:sender:precedence:x-google-loop:mailing-list :list-id:list-post:list-help:list-unsubscribe:x-beenthere-env :x-beenthere; b=uC4DtyhXJcWArFu8C/MoXGNKJZeOq2k6URBcPnZ4gJB2Z1YK4Voskhk/6v82IMRpyD juQiffMVIJjdWiCnc51FolcqA5eLCit6URY1XaUWWMEE63Ps4f1sS00mO2fvzNbnTjs3 o17wTdoFQGAVGpsGiwUvDT5KzTIpDNSJnCu3E= Received: by 10.90.115.17 with SMTP id n17mr550155agc.29.1235400804171; Mon, 23 Feb 2009 06:53:24 -0800 (PST) Received: by 10.176.150.42 with SMTP id x42gr1930yqd.0; Mon, 23 Feb 2009 06:53:24 -0800 (PST) X-Sender: mike@compulab.co.il X-Apparently-To: rtc-linux@googlegroups.com Received: by 10.100.8.4 with SMTP id 4mr4614038anh.10.1235400803475; Mon, 23 Feb 2009 06:53:23 -0800 (PST) Received: from cathcart.site5.com (cathcart.site5.com [74.54.107.137]) by mx.google.com with ESMTP id 14si1326738gxk.7.2009.02.23.06.53.23; Mon, 23 Feb 2009 06:53:23 -0800 (PST) Received-SPF: neutral (google.com: 74.54.107.137 is neither permitted nor denied by best guess record for domain of mike@compulab.co.il) client-ip=74.54.107.137; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.54.107.137 is neither permitted nor denied by best guess record for domain of mike@compulab.co.il) smtp.mail=mike@compulab.co.il Received: from [192.114.83.142] (helo=mail.linux-boards.com) by cathcart.site5.com with esmtpsa (TLSv1:DES-CBC3-SHA:168) (Exim 4.69) (envelope-from ) id 1LbcBH-0004Xa-6u; Mon, 23 Feb 2009 08:53:15 -0600 Received: from gentoodev.compulab.local (mike-pc.compulab.local [10.1.1.95]) by mail.linux-boards.com (8.12.5/8.12.8) with ESMTP id n1NErDTW013750; Mon, 23 Feb 2009 16:53:13 +0200 Received: from gentoodev.compulab.local (localhost [127.0.0.1]) by gentoodev.compulab.local (8.14.0/8.14.0) with ESMTP id n1NErDAw010563; Mon, 23 Feb 2009 16:53:13 +0200 Received: (from mike@localhost) by gentoodev.compulab.local (8.14.0/8.14.0/Submit) id n1NErDd9010562; Mon, 23 Feb 2009 16:53:13 +0200 X-Authentication-Warning: gentoodev.compulab.local: mike set sender to mike@compulab.co.il using -f From: Mike Rapoport To: a.zummo@towertech.it Cc: rtc-linux@googlegroups.com, raph@8d.com, Mike Rapoport Subject: [rtc-linux] [PATCH] rtc-v3020: coding style cleanup Date: Mon, 23 Feb 2009 16:53:10 +0200 Message-Id: X-Mailer: git-send-email 1.5.6.4 In-Reply-To: References: X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cathcart.site5.com X-AntiAbuse: Original Domain - googlegroups.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Source: X-Source-Args: X-Source-Dir: Reply-To: rtc-linux@googlegroups.com Sender: rtc-linux@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rtc-linux@googlegroups.com; contact rtc-linux+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rtc-linux@googlegroups.com X-BeenThere: rtc-linux@googlegroups.com Signed-off-by: Mike Rapoport --- drivers/rtc/rtc-v3020.c | 40 ++++++++++++++++++---------------------- 1 files changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c index 14d4f03..66955cc 100644 --- a/drivers/rtc/rtc-v3020.c +++ b/drivers/rtc/rtc-v3020.c @@ -28,7 +28,7 @@ #include #include -#include +#include #undef DEBUG @@ -63,7 +63,7 @@ static void v3020_set_reg(struct v3020 *chip, unsigned char address, static unsigned char v3020_get_reg(struct v3020 *chip, unsigned char address) { - unsigned int data=0; + unsigned int data = 0; int i; for (i = 0; i < 4; i++) { @@ -106,16 +106,14 @@ static int v3020_read_time(struct device *dev, struct rtc_time *dt) tmp = v3020_get_reg(chip, V3020_YEAR); dt->tm_year = bcd2bin(tmp)+100; -#ifdef DEBUG - printk("\n%s : Read RTC values\n",__func__); - printk("tm_hour: %i\n",dt->tm_hour); - printk("tm_min : %i\n",dt->tm_min); - printk("tm_sec : %i\n",dt->tm_sec); - printk("tm_year: %i\n",dt->tm_year); - printk("tm_mon : %i\n",dt->tm_mon); - printk("tm_mday: %i\n",dt->tm_mday); - printk("tm_wday: %i\n",dt->tm_wday); -#endif + dev_dbg(dev, "\n%s : Read RTC values\n", __func__); + dev_dbg(dev, "tm_hour: %i\n", dt->tm_hour); + dev_dbg(dev, "tm_min : %i\n", dt->tm_min); + dev_dbg(dev, "tm_sec : %i\n", dt->tm_sec); + dev_dbg(dev, "tm_year: %i\n", dt->tm_year); + dev_dbg(dev, "tm_mon : %i\n", dt->tm_mon); + dev_dbg(dev, "tm_mday: %i\n", dt->tm_mday); + dev_dbg(dev, "tm_wday: %i\n", dt->tm_wday); return 0; } @@ -125,15 +123,13 @@ static int v3020_set_time(struct device *dev, struct rtc_time *dt) { struct v3020 *chip = dev_get_drvdata(dev); -#ifdef DEBUG - printk("\n%s : Setting RTC values\n",__func__); - printk("tm_sec : %i\n",dt->tm_sec); - printk("tm_min : %i\n",dt->tm_min); - printk("tm_hour: %i\n",dt->tm_hour); - printk("tm_mday: %i\n",dt->tm_mday); - printk("tm_wday: %i\n",dt->tm_wday); - printk("tm_year: %i\n",dt->tm_year); -#endif + dev_dbg(dev, "\n%s : Setting RTC values\n", __func__); + dev_dbg(dev, "tm_sec : %i\n", dt->tm_sec); + dev_dbg(dev, "tm_min : %i\n", dt->tm_min); + dev_dbg(dev, "tm_hour: %i\n", dt->tm_hour); + dev_dbg(dev, "tm_mday: %i\n", dt->tm_mday); + dev_dbg(dev, "tm_wday: %i\n", dt->tm_wday); + dev_dbg(dev, "tm_year: %i\n", dt->tm_year); /* Write all the values to ram... */ v3020_set_reg(chip, V3020_SECONDS, bin2bcd(dt->tm_sec)); @@ -191,7 +187,7 @@ static int rtc_probe(struct platform_device *pdev) /* Test chip by doing a write/read sequence * to the chip ram */ v3020_set_reg(chip, V3020_SECONDS, 0x33); - if(v3020_get_reg(chip, V3020_SECONDS) != 0x33) { + if (v3020_get_reg(chip, V3020_SECONDS) != 0x33) { retval = -ENODEV; goto err_io; }