From patchwork Thu Feb 9 22:29:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartley Sweeten X-Patchwork-Id: 140449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-qw0-f56.google.com (mail-qw0-f56.google.com [209.85.216.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 2C605B6EEA for ; Fri, 10 Feb 2012 09:30:19 +1100 (EST) Received: by qam2 with SMTP id 2sf1759858qam.11 for ; Thu, 09 Feb 2012 14:30:17 -0800 (PST) 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=7NELHkVDVwAzT084Yurj7OJpxN4E7EwMvR0ilE6a4lk=; b=46MdEpyIMQ08dxhRgGt9rp+mV63+fdtgigR3NMWalAqI0Z5V7F9GNjbba8W625z4BU p/zg+PiVkkJWteGFl/QLju3BH8Bwijvjp9TzM0kwCpDmJyZxw0hcTtZ8PnPdbY9cAS6c o6j4KPIVIJBZnjIa+GCYUF8qkaYKNoFfjod+o= Received: by 10.229.135.212 with SMTP id o20mr212601qct.6.1328826616406; Thu, 09 Feb 2012 14:30:16 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.229.66.215 with SMTP id o23ls5760980qci.2.gmail; Thu, 09 Feb 2012 14:30:15 -0800 (PST) Received: by 10.236.176.98 with SMTP id a62mr8933881yhm.9.1328826614692; Thu, 09 Feb 2012 14:30:14 -0800 (PST) Received: by 10.236.176.98 with SMTP id a62mr8933879yhm.9.1328826614683; Thu, 09 Feb 2012 14:30:14 -0800 (PST) Received: from mail132.messagelabs.com (mail132.messagelabs.com. [216.82.242.115]) by gmr-mx.google.com with ESMTPS id dc12si2654334qcb.3.2012.02.09.14.30.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Feb 2012 14:30:14 -0800 (PST) Received-SPF: neutral (google.com: 216.82.242.115 is neither permitted nor denied by best guess record for domain of hartleys@visionengravers.com) client-ip=216.82.242.115; X-Env-Sender: hartleys@visionengravers.com X-Msg-Ref: server-2.tower-132.messagelabs.com!1328826610!1695983!15 X-Originating-IP: [216.166.12.72] X-StarScan-Version: 6.5.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31584 invoked from network); 9 Feb 2012 22:30:14 -0000 Received: from out001.collaborationhost.net (HELO out001.collaborationhost.net) (216.166.12.72) by server-2.tower-132.messagelabs.com with RC4-SHA encrypted SMTP; 9 Feb 2012 22:30:14 -0000 Received: from etch.local (10.2.3.210) by smtp.hostaccount.com (10.2.0.120) with Microsoft SMTP Server (TLS) id 8.3.137.0; Thu, 9 Feb 2012 16:30:12 -0600 From: H Hartley Sweeten To: Linux Kernel Subject: [rtc-linux] [PATCH] rtc: convert rtc-ep93xx to use module_platform_driver() Date: Thu, 9 Feb 2012 15:29:45 -0700 User-Agent: KMail/1.9.9 CC: , MIME-Version: 1.0 Message-ID: <201202091529.45783.hartleys@visionengravers.com> X-Original-Sender: hartleys@visionengravers.com X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 216.82.242.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 module_platform_driver() to remove the boilerplate code. Also, change the probe and remove functions to __devinit/__devexit. 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..9602278 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,19 @@ 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, }, - .remove = __exit_p(ep93xx_rtc_remove), + .probe = ep93xx_rtc_probe, + .remove = __devexit_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");