From patchwork Thu Jun 17 12:54:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Fietze X-Patchwork-Id: 56033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ww0-f56.google.com (mail-ww0-f56.google.com [74.125.82.56]) by ozlabs.org (Postfix) with ESMTP id B4A2AB7D64 for ; Thu, 17 Jun 2010 22:54:15 +1000 (EST) Received: by wwi14 with SMTP id 14sf2037863wwi.11 for ; Thu, 17 Jun 2010 05:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:received:comment:received:received :received:received:from:organization:to:subject:user-agent:cc :references:in-reply-to:mime-version:message-id:date:x-mimetrack :content-transfer-encoding:content-type:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=cbRVDL+V+DgjWe5HQcZIYOtpJ4APBXkTFROo9FkD41A=; b=spQ1s2LBwT8Lqly7qCU9S4M03UGFt9ZgoNBUIHNT9xPwbR2/p4VIU/RgSLh34vsSiO TukQhvRuBFCfK4rnT1ekYp+dM8VDp2ozINEYSJGc6yUQahdkg2k3e0tXh5AkBwBpNVVB JcZ8rxKW4UPB7GKC/pnUVe/wWmYgeOEvvmpBo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:comment:from:organization:to:subject :user-agent:cc:references:in-reply-to:mime-version:message-id:date :x-mimetrack:content-transfer-encoding:content-type :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; b=sav0NX7HdZlkuvTjoCzlFuVdVls/f6nolppN9RQT+NuMXKlEtAjk5bphMYpwcR6bw3 pRDe74BznLnEoZJGZr5atxhFXAcsDmftya5xEboKxjDonlg2aUwmHL+R3n+m+b16yhIV +rVmgImxAPrQ3s5e7WsOAKjrjgQ0dGyaxb12U= Received: by 10.216.82.7 with SMTP id n7mr795789wee.4.1276779253489; Thu, 17 Jun 2010 05:54:13 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.227.37.82 with SMTP id w18ls791443wbd.3.p; Thu, 17 Jun 2010 05:54:12 -0700 (PDT) Received: by 10.227.147.201 with SMTP id m9mr639920wbv.0.1276779252628; Thu, 17 Jun 2010 05:54:12 -0700 (PDT) Received: by 10.227.147.201 with SMTP id m9mr639919wbv.0.1276779252601; Thu, 17 Jun 2010 05:54:12 -0700 (PDT) Received: from coyote.quickmin.net (coyote.quickmin.net [217.14.112.24]) by gmr-mx.google.com with ESMTP id h17si9614236wbh.1.2010.06.17.05.54.11; Thu, 17 Jun 2010 05:54:11 -0700 (PDT) Received-SPF: neutral (google.com: 217.14.112.24 is neither permitted nor denied by best guess record for domain of roman.fietze@telemotive.de) client-ip=217.14.112.24; Received: (qmail 3531 invoked from network); 17 Jun 2010 14:54:09 +0200 Received: by simscan 1.4.0 ppid: 3527, pid: 3529, t: 0.0178s scanners: clamav: 0.95.2/m:49/d:8609 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys Received: from mail.telemotive.de (62.206.149.210) by coyote.quickmin.net with SMTP; 17 Jun 2010 14:54:09 +0200 Received: from alderan.mit.telemotive.de ([192.168.5.15]) by mail.telemotive.de (Lotus Domino Release 8.0.2FP1) with ESMTP id 2010061714540796-6567 ; Thu, 17 Jun 2010 14:54:07 +0200 Received: from rfietze.mit.telemotive.de (rfietze.mit.telemotive.de [192.168.5.33]) by alderan.mit.telemotive.de (Postfix) with ESMTP id 3F12BCE6D2; Thu, 17 Jun 2010 14:54:08 +0200 (CEST) Received: by rfietze.mit.telemotive.de (Postfix, from userid 10062) id ECE06205D1; Thu, 17 Jun 2010 14:54:07 +0200 (CEST) From: Roman Fietze Organization: Telemotive AG To: Wan ZongShun Subject: Re: [rtc-linux] [PATCH] isl12022: added Intersil ISL12022 RTC User-Agent: KMail/1.13.3 (Linux/2.6.31.12-0.2-default; KDE/4.4.3; x86_64; ; ) Cc: rtc-linux@googlegroups.com, Alessandro Zummo , Andrew Morton , "linux-kernel" References: <201006171123.31484.roman.fietze@telemotive.de> In-Reply-To: MIME-Version: 1.0 Message-ID: <201006171454.07593.roman.fietze@telemotive.de> Date: Thu, 17 Jun 2010 14:54:06 +0200 X-MIMETrack: Itemize by SMTP Server on muc/Telemotive(Release 8.0.2FP1|January 12, 2009) at 17.06.2010 14:54:08, Serialize by Router on muc/Telemotive(Release 8.0.2FP1|January 12, 2009) at 17.06.2010 14:54:09, Serialize complete at 17.06.2010 14:54:09 X-Original-Sender: roman.fietze@telemotive.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 217.14.112.24 is neither permitted nor denied by best guess record for domain of roman.fietze@telemotive.de) smtp.mail=roman.fietze@telemotive.de; domainkeys=pass header.From=roman.fietze@telemotive.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Hallo Wan, Thanks for the review. I added an second patch here with the proposed changes. Should I better provide an all-in-one patch instead? On Thursday 17 June 2010 12:28:11 Wan ZongShun wrote: > There is no need to print your private driver info in Kernel, please > get rid of it. Ok, I thought its good habit, just copied that 1:1 from rtc-pcf8563.c as well as the stuff with the check for ->rtc beeing zero and the order of the module macros. I can of course also provide a patch for rtc-pcf8563.c with the same changes. From 134f8488933f723489d5cf244c0b54bde1ce3622 Mon Sep 17 00:00:00 2001 From: Roman Fietze Date: Thu, 17 Jun 2010 14:45:36 +0200 Subject: [PATCH] rtc-isl12022: omit checking ->rtc in remove function, reorder module macros - isl12022->rtc cannot be NULL inside isl12022_remove - move up module init and exit macros - be less verbose inside probe function Signed-off-by: Roman Fietze --- drivers/rtc/rtc-isl12022.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c index e0a340f..293d2c1 100644 --- a/drivers/rtc/rtc-isl12022.c +++ b/drivers/rtc/rtc-isl12022.c @@ -236,8 +236,6 @@ static int isl12022_probe(struct i2c_client *client, int ret = 0; - dev_dbg(&client->dev, "%s\n", __func__); - if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) return -ENODEV; @@ -245,7 +243,7 @@ static int isl12022_probe(struct i2c_client *client, if (!isl12022) return -ENOMEM; - dev_info(&client->dev, "chip found, driver version " DRV_VERSION "\n"); + dev_dbg(&client->dev, "chip found, driver version " DRV_VERSION "\n"); i2c_set_clientdata(client, isl12022); @@ -269,9 +267,7 @@ static int isl12022_remove(struct i2c_client *client) { struct isl12022 *isl12022 = i2c_get_clientdata(client); - if (isl12022->rtc) - rtc_device_unregister(isl12022->rtc); - + rtc_device_unregister(isl12022->rtc); kfree(isl12022); return 0; @@ -303,10 +299,10 @@ static void __exit isl12022_exit(void) i2c_del_driver(&isl12022_driver); } +module_init(isl12022_init); +module_exit(isl12022_exit); + MODULE_AUTHOR("roman.fietze@telemotive.de"); MODULE_DESCRIPTION("ISL 12022 RTC driver"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION); - -module_init(isl12022_init); -module_exit(isl12022_exit);