From patchwork Sat Jul 7 20:47:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1168951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 34DBD40135 for ; Sat, 7 Jul 2012 20:53:05 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SnbwJ-000415-R8; Sat, 07 Jul 2012 20:49:15 +0000 Received: from mail-yw0-f49.google.com ([209.85.213.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Snbun-0003zh-6L for linux-arm-kernel@lists.infradead.org; Sat, 07 Jul 2012 20:47:46 +0000 Received: by yhjj52 with SMTP id j52so11759080yhj.36 for ; Sat, 07 Jul 2012 13:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=Yd6OyAjMybcdQXPRLi8qPsFupny1IiufQx/9728cGJA=; b=mBrK0JMO9HbYTigsbKMObZE/lekmDglOmlN3lcHxcuJOI3siYQxcaY32IfV4FI18aU LWlGjGTY6xPqkoXMWwDSoNPYDTbIwtpFjjFuZT+32psIlWV/CJlQ+eeUTTyfBPhxa9m5 IxnDkWa1+u+DlqAvecjdggAp+itP2AKAb2NVCZ+zpH3qiw7wPaWcw+w4v5b4sHY6aAbW SUs4XfUWJpuIEO5taNlP5Fbr83T2B1JYr2zml1RRaUcyPut5ILxBxdUrCHWL+g0FNoGT cR9wRLDJQC+WU0coz+lfA0SEhH767AHFPJwmyCuvnzjRTwX/ocT+sCMC3Ifuk+rdaksc KPvQ== Received: by 10.236.114.169 with SMTP id c29mr40463527yhh.108.1341694055184; Sat, 07 Jul 2012 13:47:35 -0700 (PDT) Received: from localhost.localdomain ([189.5.6.233]) by mx.google.com with ESMTPS id t22sm25977814anh.20.2012.07.07.13.47.33 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 Jul 2012 13:47:34 -0700 (PDT) From: Fabio Estevam To: kernel@pengutronix.de Subject: [PATCH 3/3] rtc: rtc-mxc: Convert to module_platform_driver Date: Sat, 7 Jul 2012 17:47:21 -0300 Message-Id: <1341694041-7839-3-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1341694041-7839-1-git-send-email-festevam@gmail.com> References: <1341694041-7839-1-git-send-email-festevam@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.213.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (festevam[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Fabio Estevam , a.zummo@towertech.it, akpm@linux-foundation.org, rtc-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Fabio Estevam Converting to module_platform_driver can make the code smaller and cleaner. Signed-off-by: Fabio Estevam --- drivers/rtc/rtc-mxc.c | 20 +++++--------------- 1 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index 5d8456a..33d6e27 100644 --- a/drivers/rtc/rtc-mxc.c +++ b/drivers/rtc/rtc-mxc.c @@ -343,7 +343,7 @@ static struct rtc_class_ops mxc_rtc_ops = { .alarm_irq_enable = mxc_rtc_alarm_irq_enable, }; -static int __init mxc_rtc_probe(struct platform_device *pdev) +static int __devinit mxc_rtc_probe(struct platform_device *pdev) { struct resource *res; struct rtc_device *rtc; @@ -434,7 +434,7 @@ exit_free_pdata: return ret; } -static int __exit mxc_rtc_remove(struct platform_device *pdev) +static int __devexit mxc_rtc_remove(struct platform_device *pdev) { struct rtc_plat_data *pdata = platform_get_drvdata(pdev); @@ -482,21 +482,11 @@ static struct platform_driver mxc_rtc_driver = { #endif .owner = THIS_MODULE, }, - .remove = __exit_p(mxc_rtc_remove), + .probe = mxc_rtc_probe, + .remove = __devexit_p(mxc_rtc_remove), }; -static int __init mxc_rtc_init(void) -{ - return platform_driver_probe(&mxc_rtc_driver, mxc_rtc_probe); -} - -static void __exit mxc_rtc_exit(void) -{ - platform_driver_unregister(&mxc_rtc_driver); -} - -module_init(mxc_rtc_init); -module_exit(mxc_rtc_exit); +module_platform_driver(mxc_rtc_driver); MODULE_AUTHOR("Daniel Mack "); MODULE_DESCRIPTION("RTC driver for Freescale MXC");