From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753639AbcFTWWL (ORCPT ); Mon, 20 Jun 2016 18:22:11 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:45802 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751828AbcFTWVy (ORCPT ); Mon, 20 Jun 2016 18:21:54 -0400 Subject: [PATCH] leds: Add no-op gpio_led_register_device when LED subsystem is disabled To: Jacek Anaszewski References: <20160613200211.14790-1-afd@ti.com> <20160613200211.14790-13-afd@ti.com> <5760FA52.7010806@samsung.com> <57647DBD.2010406@ti.com> <57679E38.3080901@samsung.com> CC: Russell King , Miguel Ojeda Sandonis , Linus Walleij , Sebastian Reichel , Wolfram Sang , Richard Purdie , Rusty Russell , Benjamin Herrenschmidt , Mauro Carvalho Chehab , Ulf Hansson , Lauro Ramos Venancio , Aloisio Almeida Jr , Samuel Ortiz , Ingo Molnar , , , , , , , , , , From: "Andrew F. Davis" Message-ID: <57686A94.2010704@ti.com> Date: Mon, 20 Jun 2016 17:13:40 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <57679E38.3080901@samsung.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some systems use 'gpio_led_register_device' to make an in-memory copy of their LED device table so the original can be removed as .init.rodata. When the LED subsystem is not enabled source in the led directory is not built and so this function may be undefined. Fix this here. Signed-off-by: Andrew F. Davis --- include/linux/leds.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/leds.h b/include/linux/leds.h index d2b1306..a4a3da6 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -386,8 +386,16 @@ struct gpio_led_platform_data { unsigned long *delay_off); }; +#ifdef CONFIG_NEW_LEDS struct platform_device *gpio_led_register_device( int id, const struct gpio_led_platform_data *pdata); +#else +static inline struct platform_device *gpio_led_register_device( + int id, const struct gpio_led_platform_data *pdata) +{ + return 0; +} +#endif enum cpu_led_event { CPU_LED_IDLE_START, /* CPU enters idle */ -- 2.9.0