From patchwork Tue Jul 24 08:54:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 1230761 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 DB8323FD4F for ; Tue, 24 Jul 2012 09:09:49 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Stb0W-0001Tt-1B; Tue, 24 Jul 2012 09:02:20 +0000 Received: from na3sys009aog108.obsmtp.com ([74.125.149.199]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1Stavl-00019O-C5 for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2012 08:57:26 +0000 Received: from mail-lpp01m010-f51.google.com ([209.85.215.51]) (using TLSv1) by na3sys009aob108.postini.com ([74.125.148.12]) with SMTP ID DSNKUA5jcudpMFr4jm4bJMS4sJhRUc4kYMDb@postini.com; Tue, 24 Jul 2012 01:57:25 PDT Received: by lagw12 with SMTP id w12so603947lag.38 for ; Tue, 24 Jul 2012 01:57:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=n2y4nF+uOjPJoL7bVbBqOVuwz2DcmEyFd2bqBSTSVqU=; b=A3SKqT4bo5EStLDkXwx9jd7l5O7G1aFbJ8zhetPftXRgwYjDUNRi5sZcBn91fmfwuF IZIlg/kjdyVA+PwQ3TkMIhwWIBvf22umPid0JlhDRz69P0QL0bQjCsc4PTJfw/jalR2g 3FD+Hbw9w5dbvJNljR3WJ/sSYtnFSd0gSlXHlHSS6xvCdV+Lz4zW3v6s5eLIZtUOxnWg +QxeYBUPkrQaHbgNWzu2elTq3qFsdHq+LFWPD0Q5SAjRcd4awgy7157lEMarmUEClgV0 z+8EBDJFz1+DoNcFWbKyqvtRXFszqBzFcsLTDGgz92S1oXXR0/z5fQZGI9ELvBQyClLB uL8Q== Received: by 10.152.46.232 with SMTP id y8mr20681840lam.18.1343120241438; Tue, 24 Jul 2012 01:57:21 -0700 (PDT) Received: from localhost (cs78217178.pp.htv.fi. [62.78.217.178]) by mx.google.com with ESMTPS id n7sm3632280lbk.10.2012.07.24.01.57.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 01:57:20 -0700 (PDT) From: Felipe Balbi To: Tony Lindgren Subject: [PATCH 4/5] arm: omap: debug-leds: add a remove method Date: Tue, 24 Jul 2012 11:54:01 +0300 Message-Id: <1343120042-16695-5-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.11 In-Reply-To: <1343120042-16695-1-git-send-email-balbi@ti.com> References: <1343120042-16695-1-git-send-email-balbi@ti.com> X-Gm-Message-State: ALoCoQnqks9sOF/dkOXiNKZ+Pl2UbEB8GWsyB1100osPmPcYt/b6A8juAIKCYyaZoM7y1rA+xTVt X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.199 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Linux OMAP Mailing List , Felipe Balbi , Linux ARM Kernel Mailing List 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 while at that, also convert to module_platform_driver Signed-off-by: Felipe Balbi --- arch/arm/plat-omap/debug-leds.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c index 392daa8..08fbb85 100644 --- a/arch/arm/plat-omap/debug-leds.c +++ b/arch/arm/plat-omap/debug-leds.c @@ -251,6 +251,14 @@ static void __devinit newled_init(struct device *dev) return; } +static void __devexit newled_exit(void) +{ + unsigned i; + struct dbg_led *led; + + for (i = 0, led = dbg_leds; i < ARRAY_SIZE(dbg_leds); i++, led++) + led_classdev_unregister(&led->cdev); +} /*-------------------------------------------------------------------------*/ @@ -279,6 +287,16 @@ static int __devinit fpga_probe(struct platform_device *pdev) return 0; } +static int __devexit fpga_remove(struct platform_device *pdev) +{ + if (new_led_api()) + newled_exit(); + + iounmap(fpga); + + return 0; +} + static int fpga_suspend_noirq(struct device *dev) { __raw_writew(~0, &fpga->leds); @@ -300,10 +318,7 @@ static struct platform_driver led_driver = { .driver.name = "omap_dbg_led", .driver.pm = &fpga_dev_pm_ops, .probe = fpga_probe, + .remove = __devexit_p(fpga_remove), }; -static int __init fpga_init(void) -{ - return platform_driver_register(&led_driver); -} -module_init(fpga_init); +module_platform_driver(led_driver);