aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-05-08 04:27:54 -0400
committerChris Ball <chris@printf.net>2014-05-12 18:08:23 -0400
commitb677b8850322b210a81b72ffcc7de85a3df395c5 (patch)
tree572c644e22de19af83d4e00e27333e3cec584972
parent91769986a724f63db52f3c78c79ac84a5b7045bf (diff)
mmc: rtsx: fix possible linking error if built-in
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@realtek.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r--drivers/mmc/host/rtsx_usb_sdmmc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
index e11fafa6fc6b..5d3766e792f0 100644
--- a/drivers/mmc/host/rtsx_usb_sdmmc.c
+++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
@@ -34,7 +34,8 @@
34#include <linux/mfd/rtsx_usb.h> 34#include <linux/mfd/rtsx_usb.h>
35#include <asm/unaligned.h> 35#include <asm/unaligned.h>
36 36
37#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 37#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \
38 defined(CONFIG_MMC_REALTEK_USB_MODULE))
38#include <linux/leds.h> 39#include <linux/leds.h>
39#include <linux/workqueue.h> 40#include <linux/workqueue.h>
40#define RTSX_USB_USE_LEDS_CLASS 41#define RTSX_USB_USE_LEDS_CLASS
@@ -59,7 +60,7 @@ struct rtsx_usb_sdmmc {
59 60
60 unsigned char power_mode; 61 unsigned char power_mode;
61 62
62#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 63#ifdef RTSX_USB_USE_LEDS_CLASS
63 struct led_classdev led; 64 struct led_classdev led;
64 char led_name[32]; 65 char led_name[32];
65 struct work_struct led_work; 66 struct work_struct led_work;