From patchwork Sat Dec 22 19:31:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Dunn X-Patchwork-Id: 1906261 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 C2BAA40077 for ; Sat, 22 Dec 2012 19:35:30 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TmUnk-0002GZ-QP; Sat, 22 Dec 2012 19:32:04 +0000 Received: from smtp.newsguy.com ([74.209.136.69]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TmUnU-0002FD-4u for linux-arm-kernel@lists.infradead.org; Sat, 22 Dec 2012 19:31:50 +0000 Received: from localhost.localdomain (191.sub-70-199-233.myvzw.com [70.199.233.191]) by smtp.newsguy.com (8.14.3/8.14.3) with ESMTP id qBMJVYAA082365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Dec 2012 11:31:45 -0800 (PST) (envelope-from mikedunn@newsguy.com) From: Mike Dunn To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] ARM: pxa: palmtreo: fix #ifdefs for leds-gpio device Date: Sat, 22 Dec 2012 11:31:58 -0800 Message-Id: <1356204719-3317-3-git-send-email-mikedunn@newsguy.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1356204719-3317-1-git-send-email-mikedunn@newsguy.com> References: <1356204719-3317-1-git-send-email-mikedunn@newsguy.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121222_143148_494400_3D7F5D9D X-CRM114-Status: GOOD ( 10.79 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: marex@denx.de, Mike Dunn 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 The #ifdefs around the leds-gpio device platform data are erroneous. Currently the device is not instantiated on the centro unless CONFIG_MACH_TREO680 is defined. Signed-off-by: Mike Dunn --- The #ifdefs within palmtreo_leds_init() are a little ugly, but I think the only alternative would be to instantiate the leds-gpio device platform data for both treo680 and centro, which would require some of the #defines in palmtreo.h to be moved outside their containing #ifdef CONFIG_MACH_{TREO680,CENTRO}. arch/arm/mach-pxa/palmtreo.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index dcc38a1..cb9cc7b 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c @@ -357,7 +357,9 @@ static struct gpio_led_platform_data treo680_gpio_led_info = { .leds = treo680_gpio_leds, .num_leds = ARRAY_SIZE(treo680_gpio_leds), }; +#endif +#ifdef CONFIG_MACH_CENTRO static struct gpio_led centro_gpio_leds[] = { { .name = "centro:vibra:vibra", @@ -381,25 +383,25 @@ static struct gpio_led_platform_data centro_gpio_led_info = { .leds = centro_gpio_leds, .num_leds = ARRAY_SIZE(centro_gpio_leds), }; +#endif static struct platform_device palmtreo_leds = { .name = "leds-gpio", .id = -1, - .dev = { - .platform_data = &treo680_gpio_led_info, - } }; static void __init palmtreo_leds_init(void) { +#ifdef CONFIG_MACH_CENTRO if (machine_is_centro()) palmtreo_leds.dev.platform_data = ¢ro_gpio_led_info; - +#endif +#ifdef CONFIG_MACH_TREO680 + if (machine_is_treo680()) + palmtreo_leds.dev.platform_data = &treo680_gpio_led_info; +#endif platform_device_register(&palmtreo_leds); } -#else -static inline void palmtreo_leds_init(void) {} -#endif /****************************************************************************** * Machine init