From patchwork Tue May 10 08:50:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 94961 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 34A9AB6EF3 for ; Tue, 10 May 2011 18:51:49 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QJifR-00087n-Bi; Tue, 10 May 2011 08:51:45 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1QJifP-0000FU-Uj; Tue, 10 May 2011 08:51:44 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1QJifL-0000F2-FX for linux-arm-kernel@lists.infradead.org; Tue, 10 May 2011 08:51:40 +0000 Received: from octopus.hi.pengutronix.de ([2001:6f8:1178:2:215:17ff:fe12:23b0]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1QJier-0005Kv-He; Tue, 10 May 2011 10:51:09 +0200 Received: from ukl by octopus.hi.pengutronix.de with local (Exim 4.75) (envelope-from ) id 1QJiep-0003CB-QP; Tue, 10 May 2011 10:51:07 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Andrew Morton Subject: [PATCH] [wip] ARM: imx: register "leds-gpio" device using new helper function Date: Tue, 10 May 2011 10:50:56 +0200 Message-Id: <1305017456-10910-2-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1305017456-10910-1-git-send-email-u.kleine-koenig@pengutronix.de> References: <20110510073152.GF29089@pengutronix.de> <1305017456-10910-1-git-send-email-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:215:17ff:fe12:23b0 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110510_045139_962613_94689940 X-CRM114-Status: GOOD ( 20.51 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Fabio Estevam , Russell King - ARM Linux , Sascha Hauer , linux-kernel@vger.kernel.org, Richard Purdie , kernel@pengutronix.de, H Hartley Sweeten , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org This converts eukrea_mbimx27-baseboard to the new helper function. bloat-o-meter reports for this change: add/remove: 1/1 grow/shrink: 0/1 up/down: 128/-220 (-92) function old new delta gpio_led_register_device - 128 +128 platform_devices 28 24 -4 leds_gpio 216 - -216 Additionally gpio_led_info (12 bytes) and gpio_leds (32 Bytes) are initdata now as is gpio_led_register_device. Signed-off-by: Uwe Kleine-König --- This is just an example and probably doesn't apply to the imx tree as is. I will convert all imx machines when there's an agreement for the patch providing the helper function. arch/arm/mach-imx/Kconfig | 1 + arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 18 +++--------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 56b930a..ef16471 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -222,6 +222,7 @@ choice config MACH_EUKREA_MBIMX27_BASEBOARD bool "Eukrea MBIMX27 development board" + select LEDS_GPIO_REGISTER select IMX_HAVE_PLATFORM_IMX_FB select IMX_HAVE_PLATFORM_IMX_KEYPAD select IMX_HAVE_PLATFORM_IMX_SSI diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index fa5288018..3479f66 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c @@ -113,7 +113,7 @@ eukrea_mbimx27_keymap_data __initconst = { .keymap_size = ARRAY_SIZE(eukrea_mbimx27_keymap), }; -static struct gpio_led gpio_leds[] = { +static const struct gpio_led gpio_leds[] __initconst = { { .name = "led1", .default_trigger = "heartbeat", @@ -128,19 +128,11 @@ static struct gpio_led gpio_leds[] = { }, }; -static struct gpio_led_platform_data gpio_led_info = { +static const struct gpio_led_platform_data gpio_led_info __initconst = { .leds = gpio_leds, .num_leds = ARRAY_SIZE(gpio_leds), }; -static struct platform_device leds_gpio = { - .name = "leds-gpio", - .id = -1, - .dev = { - .platform_data = &gpio_led_info, - }, -}; - static struct imx_fb_videomode eukrea_mbimx27_modes[] = { { .mode = { @@ -294,10 +286,6 @@ static struct i2c_board_info eukrea_mbimx27_i2c_devices[] = { }, }; -static struct platform_device *platform_devices[] __initdata = { - &leds_gpio, -}; - static const struct imxmmc_platform_data sdhc_pdata __initconst = { .dat3_card_detect = 1, }; @@ -378,5 +366,5 @@ void __init eukrea_mbimx27_baseboard_init(void) imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data); - platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); + gpio_led_register_device(-1, &gpio_led_info); }