[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFrP=kbd4On_PSOP1u4MvHaL7S7sR7EjVJALym=smAKVOQ@mail.gmail.com>
Date: Thu, 8 May 2014 10:31:58 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Lee Jones <lee.jones@...aro.org>,
Samuel Ortiz <sameo@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
devel@...uxdriverproject.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-mmc <linux-mmc@...r.kernel.org>,
Wei WANG <wei_wang@...lsil.com.cn>,
Roger <rogerable@...ltek.com>
Subject: Re: [PATCH v2] mmc: rtsx: fix possible linking error if built-in
On 8 May 2014 10:27, Arnd Bergmann <arnd@...db.de> wrote:
> rtsx_usb_sdmmc module uses the LED classdev if available, but the code
> failed to consider the situation that it is built-in and the LED classdev is a
> module, leading to following linking error:
>
> LD init/built-in.o
> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove':
> rtsx_usb_sdmmc.c:(.text+0x2a018e): undefined reference to
> `led_classdev_unregister'
> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe':
> rtsx_usb_sdmmc.c:(.text+0x2a197e): undefined reference to
> `led_classdev_register'
>
> Fix by excluding such condition when defining macro RTSX_USB_USE_LEDS_CLASS.
>
> Signed-off-by: Roger Tseng <rogerable@...ltek.com>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Acked-by: Ulf Hansson <ulf.hansson@...aro.org>
> ---
> v2 by Arnd: change the second #ifdef as well.
Thanks Arnd, Roger - I will include this one in PR that I send to
Chris in the next few days.
Kind regards
Ulf Hansson
>
> diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
> index e11fafa..5d3766e 100644
> --- a/drivers/mmc/host/rtsx_usb_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
> @@ -34,7 +34,8 @@
> #include <linux/mfd/rtsx_usb.h>
> #include <asm/unaligned.h>
>
> -#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
> +#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
> + defined(CONFIG_MMC_REALTEK_USB_MODULE))
> #include <linux/leds.h>
> #include <linux/workqueue.h>
> #define RTSX_USB_USE_LEDS_CLASS
> @@ -59,7 +60,7 @@ struct rtsx_usb_sdmmc {
>
> unsigned char power_mode;
>
> -#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
> +#ifdef RTSX_USB_USE_LEDS_CLASS
> struct led_classdev led;
> char led_name[32];
> struct work_struct led_work;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists