From patchwork Wed Mar 21 18:04:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 148047 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pb0-f56.google.com (mail-pb0-f56.google.com [209.85.160.56]) (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 A2C3AB6FF9 for ; Thu, 22 Mar 2012 05:04:56 +1100 (EST) Received: by pbcun4 with SMTP id un4sf877576pbc.11 for ; Wed, 21 Mar 2012 11:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:x-env-sender:x-msg-ref:x-originating-ip :x-starscan-version:x-viruschecked:from:to:subject:date:user-agent :cc:mime-version:message-id: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:content-disposition; bh=4X9bF7MRHUy/EpWxJoA01Ynwdcy6MRtK9Jb1zprvIdI=; b=4C/+cDKrnf8r3tCs9VyzlY0KXMj3lKKtvss542enpgefNQiLErqMLhPIK2Fi15A+pP ufcb2Ts81QBdkUachdIRGTq4bZ/AKoujey+vBm03zzsDal+i02rZZVlb0u2TjKwQ5kJu LzMWn6G/IccAT1AyZhyi2Kfm7vQmvliA/15mA= Received: by 10.229.105.129 with SMTP id t1mr173021qco.12.1332353093044; Wed, 21 Mar 2012 11:04:53 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.224.195.10 with SMTP id ea10ls2220650qab.9.gmail; Wed, 21 Mar 2012 11:04:52 -0700 (PDT) Received: by 10.224.186.204 with SMTP id ct12mr2512637qab.0.1332353092544; Wed, 21 Mar 2012 11:04:52 -0700 (PDT) Received: by 10.224.186.204 with SMTP id ct12mr2512636qab.0.1332353092528; Wed, 21 Mar 2012 11:04:52 -0700 (PDT) Received: from mail127.messagelabs.com (mail127.messagelabs.com. [216.82.250.115]) by gmr-mx.google.com with ESMTPS id d8si975769qcu.1.2012.03.21.11.04.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Mar 2012 11:04:52 -0700 (PDT) Received-SPF: neutral (google.com: 216.82.250.115 is neither permitted nor denied by best guess record for domain of hartleys@visionengravers.com) client-ip=216.82.250.115; X-Env-Sender: hartleys@visionengravers.com X-Msg-Ref: server-11.tower-127.messagelabs.com!1332353069!1130954!22 X-Originating-IP: [216.166.12.178] X-StarScan-Version: 6.5.7; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6856 invoked from network); 21 Mar 2012 18:04:51 -0000 Received: from out001.collaborationhost.net (HELO out001.collaborationhost.net) (216.166.12.178) by server-11.tower-127.messagelabs.com with RC4-SHA encrypted SMTP; 21 Mar 2012 18:04:51 -0000 Received: from etch.local (10.2.3.210) by smtp.collaborationhost.net (10.2.0.191) with Microsoft SMTP Server (TLS) id 8.3.213.0; Wed, 21 Mar 2012 13:04:41 -0500 From: H Hartley Sweeten To: Linux Kernel Subject: [rtc-linux] [PATCH] rtc: ep93xx: use module_platform_driver Date: Wed, 21 Mar 2012 11:04:36 -0700 User-Agent: KMail/1.9.9 CC: , MIME-Version: 1.0 Message-ID: <201203211104.36313.hartleys@visionengravers.com> X-Original-Sender: hartleys@visionengravers.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 216.82.250.115 is neither permitted nor denied by best guess record for domain of hartleys@visionengravers.com) smtp.mail=hartleys@visionengravers.com 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: , Content-Disposition: inline Use the module_platform_driver() macro to remove some boilerplate code. Signed-off-by: H Hartley Sweeten Cc: Alessandro Zummo diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c index 14a42a1..9f55212 100644 --- a/drivers/rtc/rtc-ep93xx.c +++ b/drivers/rtc/rtc-ep93xx.c @@ -127,7 +127,7 @@ static const struct attribute_group ep93xx_rtc_sysfs_files = { .attrs = ep93xx_rtc_attrs, }; -static int __init ep93xx_rtc_probe(struct platform_device *pdev) +static int __devinit ep93xx_rtc_probe(struct platform_device *pdev) { struct ep93xx_rtc *ep93xx_rtc; struct resource *res; @@ -174,7 +174,7 @@ exit: return err; } -static int __exit ep93xx_rtc_remove(struct platform_device *pdev) +static int __devexit ep93xx_rtc_remove(struct platform_device *pdev) { struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev); @@ -186,31 +186,18 @@ static int __exit ep93xx_rtc_remove(struct platform_device *pdev) return 0; } -/* work with hotplug and coldplug */ -MODULE_ALIAS("platform:ep93xx-rtc"); - static struct platform_driver ep93xx_rtc_driver = { .driver = { .name = "ep93xx-rtc", .owner = THIS_MODULE, }, + .probe = ep93xx_rtc_probe, .remove = __exit_p(ep93xx_rtc_remove), }; - -static int __init ep93xx_rtc_init(void) -{ - return platform_driver_probe(&ep93xx_rtc_driver, ep93xx_rtc_probe); -} - -static void __exit ep93xx_rtc_exit(void) -{ - platform_driver_unregister(&ep93xx_rtc_driver); -} +module_platform_driver(ep93xx_rtc_driver); MODULE_AUTHOR("Alessandro Zummo "); MODULE_DESCRIPTION("EP93XX RTC driver"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION); - -module_init(ep93xx_rtc_init); -module_exit(ep93xx_rtc_exit); +MODULE_ALIAS("platform:ep93xx-rtc");