Re: [PATCH] mmc: rtsx: usb backend needs LED support
>>> >>> From: Roger Tseng >>> Date: Wed, 30 Apr 2014 11:11:25 +0800 >>> Subject: [PATCH] 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 >> >> >> Acked-by: Ulf Hansson >> > > Would this patch be merged into linux-next or Lee's mfd.git > ib-mfd-mmc-memstick-3.16 branch? This is for Chris' tree. Kind regards Ulf Hansson > > By the way, should I resend my version? > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
> >>From: Roger Tseng > >>Date: Wed, 30 Apr 2014 11:11:25 +0800 > >>Subject: [PATCH] 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 > > > >Acked-by: Ulf Hansson > > Would this patch be merged into linux-next or Lee's mfd.git > ib-mfd-mmc-memstick-3.16 branch? This patch doesn't have anything to do with MFD. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On Thursday 08 May 2014 16:08:15 Roger wrote: > > Would this patch be merged into linux-next or Lee's mfd.git > ib-mfd-mmc-memstick-3.16 branch? It should get merged into whatever tree holds the existing patches, yes > By the way, should I resend my version? Actually I found another issue with it and fixed it up here, let me send the version that works for me. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 04/30/2014 04:19 PM, Ulf Hansson wrote: On 30 April 2014 05:34, Roger wrote: On 04/29/2014 08:46 PM, Arnd Bergmann wrote: On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: On 29 April 2014 11:45, Arnd Bergmann wrote: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Ah, right, I misinterpreted the bug. Here is a new version: 8<- From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver uses the LED classdev base support if available, but that fails if the classdev is a module and the MMC driver is built-in, leading to this link error. drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig to ensure that the MMC driver has to be a module if LEDS_CLASS is a module, but still allows it to be built-in if LEDS_CLASS is either disabled or built-in. Signed-off-by: Arnd Bergmann diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..68da9b8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate "Realtek USB SD/MMC Card Interface Driver" depends on MFD_RTSX_USB + depends on m || LEDS_CLASS!=m help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader . I think Ulf's idea is to fix the bug by modifying the .c files. I really found the problem of my ifdef hackery and it should do something similar in sdhci.c as: From: Roger Tseng Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 Acked-by: Ulf Hansson Would this patch be merged into linux-next or Lee's mfd.git ib-mfd-mmc-memstick-3.16 branch? By the way, should I resend my version? --- drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index e11fafa..38bdda5 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -34,7 +34,8 @@ #include #include -#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 #include #define RTSX_USB_USE_LEDS_CLASS Best regards, Roger Tseng -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 04/30/2014 04:19 PM, Ulf Hansson wrote: On 30 April 2014 05:34, Roger rogera...@realtek.com wrote: On 04/29/2014 08:46 PM, Arnd Bergmann wrote: On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: On 29 April 2014 11:45, Arnd Bergmann a...@arndb.de wrote: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Ah, right, I misinterpreted the bug. Here is a new version: 8- From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann a...@arndb.de Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver uses the LED classdev base support if available, but that fails if the classdev is a module and the MMC driver is built-in, leading to this link error. drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig to ensure that the MMC driver has to be a module if LEDS_CLASS is a module, but still allows it to be built-in if LEDS_CLASS is either disabled or built-in. Signed-off-by: Arnd Bergmann a...@arndb.de diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..68da9b8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate Realtek USB SD/MMC Card Interface Driver depends on MFD_RTSX_USB + depends on m || LEDS_CLASS!=m help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader . I think Ulf's idea is to fix the bug by modifying the .c files. I really found the problem of my ifdef hackery and it should do something similar in sdhci.c as: From: Roger Tseng rogera...@realtek.com Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 rogera...@realtek.com Acked-by: Ulf Hansson ulf.hans...@linaro.org Would this patch be merged into linux-next or Lee's mfd.git ib-mfd-mmc-memstick-3.16 branch? By the way, should I resend my version? --- drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index e11fafa..38bdda5 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 Best regards, Roger Tseng -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On Thursday 08 May 2014 16:08:15 Roger wrote: Would this patch be merged into linux-next or Lee's mfd.git ib-mfd-mmc-memstick-3.16 branch? It should get merged into whatever tree holds the existing patches, yes By the way, should I resend my version? Actually I found another issue with it and fixed it up here, let me send the version that works for me. Arnd -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
From: Roger Tseng rogera...@realtek.com Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 rogera...@realtek.com Acked-by: Ulf Hansson ulf.hans...@linaro.org Would this patch be merged into linux-next or Lee's mfd.git ib-mfd-mmc-memstick-3.16 branch? This patch doesn't have anything to do with MFD. -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
From: Roger Tseng rogera...@realtek.com Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 rogera...@realtek.com Acked-by: Ulf Hansson ulf.hans...@linaro.org Would this patch be merged into linux-next or Lee's mfd.git ib-mfd-mmc-memstick-3.16 branch? This is for Chris' tree. Kind regards Ulf Hansson By the way, should I resend my version? -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 30 April 2014 05:34, Roger wrote: > > On 04/29/2014 08:46 PM, Arnd Bergmann wrote: >> >> On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: >>> >>> On 29 April 2014 11:45, Arnd Bergmann wrote: >>>> >>>> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': >>>> :(.text+0x806480): undefined reference to `led_classdev_unregister' >>>> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': >>>> :(.text+0x806708): undefined reference to `led_classdev_register' >>>> >>>> This adds an explicit dependency in Kconfig >>> >>> >>> I think the proper solution is to fix the dependency in the driver code >>> instead. >>> >>> There are already some ifdefs hackery for making it optional to use >>> leds, apparently that's not working properly. >>> >> >> Ah, right, I misinterpreted the bug. Here is a new version: >> >> 8<- >>> >>> From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 >> >> From: Arnd Bergmann >> Date: Tue, 29 Apr 2014 11:41:40 +0200 >> Subject: [PATCH] mmc: rtsx: usb backend needs LED support >> >> Building the rtsx USB driver uses the LED classdev base >> support if available, but that fails if the classdev >> is a module and the MMC driver is built-in, leading to this >> link error. >> >> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': >> :(.text+0x806480): undefined reference to `led_classdev_unregister' >> drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': >> :(.text+0x806708): undefined reference to `led_classdev_register' >> >> This adds an explicit dependency in Kconfig to ensure that >> the MMC driver has to be a module if LEDS_CLASS is a module, >> but still allows it to be built-in if LEDS_CLASS is either >> disabled or built-in. >> >> Signed-off-by: Arnd Bergmann >> >> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig >> index 92d91fe..68da9b8 100644 >> >> --- a/drivers/mmc/host/Kconfig >> +++ b/drivers/mmc/host/Kconfig >> @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI >> config MMC_REALTEK_USB >> tristate "Realtek USB SD/MMC Card Interface Driver" >> depends on MFD_RTSX_USB >> + depends on m || LEDS_CLASS!=m >> >> help >> Say Y here to include driver code to support SD/MMC card >> interface >> of Realtek RTS5129/39 series card reader >> >> . >> > > I think Ulf's idea is to fix the bug by modifying the .c files. > I really found the problem of my ifdef hackery and it should do something > similar in sdhci.c as: > > From: Roger Tseng > Date: Wed, 30 Apr 2014 11:11:25 +0800 > Subject: [PATCH] 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 Acked-by: Ulf Hansson > --- > drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c > b/drivers/mmc/host/rtsx_usb_sdmmc.c > index e11fafa..38bdda5 100644 > --- a/drivers/mmc/host/rtsx_usb_sdmmc.c > +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c > @@ -34,7 +34,8 @@ > #include > #include > > -#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 > #include > #define RTSX_USB_USE_LEDS_CLASS > > Best regards, > Roger Tseng -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On Wednesday 30 April 2014 11:34:33 Roger wrote: > I think Ulf's idea is to fix the bug by modifying the .c files. > I really found the problem of my ifdef hackery and it should do > something similar in sdhci.c as: > > From: Roger Tseng > Date: Wed, 30 Apr 2014 11:11:25 +0800 > Subject: [PATCH] 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 Yes, that should work, too. Acked-by: Arnd Bergmann > --- > drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c > b/drivers/mmc/host/rtsx_usb_sdmmc.c > index e11fafa..38bdda5 100644 > --- a/drivers/mmc/host/rtsx_usb_sdmmc.c > +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c > @@ -34,7 +34,8 @@ > #include > #include > > -#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 > #include > #define RTSX_USB_USE_LEDS_CLASS > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On Wednesday 30 April 2014 11:34:33 Roger wrote: I think Ulf's idea is to fix the bug by modifying the .c files. I really found the problem of my ifdef hackery and it should do something similar in sdhci.c as: From: Roger Tseng rogera...@realtek.com Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 rogera...@realtek.com Yes, that should work, too. Acked-by: Arnd Bergmann a...@arndb.de --- drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index e11fafa..38bdda5 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 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 30 April 2014 05:34, Roger rogera...@realtek.com wrote: On 04/29/2014 08:46 PM, Arnd Bergmann wrote: On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: On 29 April 2014 11:45, Arnd Bergmann a...@arndb.de wrote: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Ah, right, I misinterpreted the bug. Here is a new version: 8- From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann a...@arndb.de Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver uses the LED classdev base support if available, but that fails if the classdev is a module and the MMC driver is built-in, leading to this link error. drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig to ensure that the MMC driver has to be a module if LEDS_CLASS is a module, but still allows it to be built-in if LEDS_CLASS is either disabled or built-in. Signed-off-by: Arnd Bergmann a...@arndb.de diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..68da9b8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate Realtek USB SD/MMC Card Interface Driver depends on MFD_RTSX_USB + depends on m || LEDS_CLASS!=m help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader . I think Ulf's idea is to fix the bug by modifying the .c files. I really found the problem of my ifdef hackery and it should do something similar in sdhci.c as: From: Roger Tseng rogera...@realtek.com Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 rogera...@realtek.com Acked-by: Ulf Hansson ulf.hans...@linaro.org --- drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index e11fafa..38bdda5 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 Best regards, Roger Tseng -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 04/29/2014 08:46 PM, Arnd Bergmann wrote: On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: On 29 April 2014 11:45, Arnd Bergmann wrote: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Ah, right, I misinterpreted the bug. Here is a new version: 8<- From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver uses the LED classdev base support if available, but that fails if the classdev is a module and the MMC driver is built-in, leading to this link error. drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig to ensure that the MMC driver has to be a module if LEDS_CLASS is a module, but still allows it to be built-in if LEDS_CLASS is either disabled or built-in. Signed-off-by: Arnd Bergmann diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..68da9b8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate "Realtek USB SD/MMC Card Interface Driver" depends on MFD_RTSX_USB + depends on m || LEDS_CLASS!=m help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader . I think Ulf's idea is to fix the bug by modifying the .c files. I really found the problem of my ifdef hackery and it should do something similar in sdhci.c as: From: Roger Tseng Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 --- drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index e11fafa..38bdda5 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -34,7 +34,8 @@ #include #include -#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 #include #define RTSX_USB_USE_LEDS_CLASS Best regards, Roger Tseng -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: > On 29 April 2014 11:45, Arnd Bergmann wrote: > > drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': > > :(.text+0x806480): undefined reference to `led_classdev_unregister' > > drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': > > :(.text+0x806708): undefined reference to `led_classdev_register' > > > > This adds an explicit dependency in Kconfig > > I think the proper solution is to fix the dependency in the driver code > instead. > > There are already some ifdefs hackery for making it optional to use > leds, apparently that's not working properly. > Ah, right, I misinterpreted the bug. Here is a new version: 8<- >From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver uses the LED classdev base support if available, but that fails if the classdev is a module and the MMC driver is built-in, leading to this link error. drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig to ensure that the MMC driver has to be a module if LEDS_CLASS is a module, but still allows it to be built-in if LEDS_CLASS is either disabled or built-in. Signed-off-by: Arnd Bergmann diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..68da9b8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate "Realtek USB SD/MMC Card Interface Driver" depends on MFD_RTSX_USB + depends on m || LEDS_CLASS!=m help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 29 April 2014 11:45, Arnd Bergmann wrote: > [hijacking the thread since it has the right Cc list already, sorry] > > I stumbled over this doing randconfig builds on linux-next > > 8<-- > > From c11f54f1e5ea0557e076867ca31c90bcb20e3e0c Mon Sep 17 00:00:00 2001 > From: Arnd Bergmann > Date: Tue, 29 Apr 2014 11:41:40 +0200 > Subject: [PATCH] mmc: rtsx: usb backend needs LED support > > Building the rtsx USB driver requires the LED classdev base > support, otherwise we get this build error: > > drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': > :(.text+0x806480): undefined reference to `led_classdev_unregister' > drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': > :(.text+0x806708): undefined reference to `led_classdev_register' > > This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Kind regards Ulf Hansson > > Signed-off-by: Arnd Bergmann > > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig > index 92d91fe..66aedf3 100644 > --- a/drivers/mmc/host/Kconfig > +++ b/drivers/mmc/host/Kconfig > @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI > config MMC_REALTEK_USB > tristate "Realtek USB SD/MMC Card Interface Driver" > depends on MFD_RTSX_USB > + depends on LEDS_CLASS > help > Say Y here to include driver code to support SD/MMC card interface > of Realtek RTS5129/39 series card reader > > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] mmc: rtsx: usb backend needs LED support
[hijacking the thread since it has the right Cc list already, sorry] I stumbled over this doing randconfig builds on linux-next 8<-- >From c11f54f1e5ea0557e076867ca31c90bcb20e3e0c Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver requires the LED classdev base support, otherwise we get this build error: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig Signed-off-by: Arnd Bergmann diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..66aedf3 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate "Realtek USB SD/MMC Card Interface Driver" depends on MFD_RTSX_USB + depends on LEDS_CLASS help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] mmc: rtsx: usb backend needs LED support
[hijacking the thread since it has the right Cc list already, sorry] I stumbled over this doing randconfig builds on linux-next 8-- From c11f54f1e5ea0557e076867ca31c90bcb20e3e0c Mon Sep 17 00:00:00 2001 From: Arnd Bergmann a...@arndb.de Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver requires the LED classdev base support, otherwise we get this build error: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig Signed-off-by: Arnd Bergmann a...@arndb.de diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..66aedf3 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate Realtek USB SD/MMC Card Interface Driver depends on MFD_RTSX_USB + depends on LEDS_CLASS help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 29 April 2014 11:45, Arnd Bergmann a...@arndb.de wrote: [hijacking the thread since it has the right Cc list already, sorry] I stumbled over this doing randconfig builds on linux-next 8-- From c11f54f1e5ea0557e076867ca31c90bcb20e3e0c Mon Sep 17 00:00:00 2001 From: Arnd Bergmann a...@arndb.de Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver requires the LED classdev base support, otherwise we get this build error: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Kind regards Ulf Hansson Signed-off-by: Arnd Bergmann a...@arndb.de diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..66aedf3 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate Realtek USB SD/MMC Card Interface Driver depends on MFD_RTSX_USB + depends on LEDS_CLASS help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: On 29 April 2014 11:45, Arnd Bergmann a...@arndb.de wrote: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Ah, right, I misinterpreted the bug. Here is a new version: 8- From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann a...@arndb.de Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver uses the LED classdev base support if available, but that fails if the classdev is a module and the MMC driver is built-in, leading to this link error. drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig to ensure that the MMC driver has to be a module if LEDS_CLASS is a module, but still allows it to be built-in if LEDS_CLASS is either disabled or built-in. Signed-off-by: Arnd Bergmann a...@arndb.de diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..68da9b8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate Realtek USB SD/MMC Card Interface Driver depends on MFD_RTSX_USB + depends on m || LEDS_CLASS!=m help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] mmc: rtsx: usb backend needs LED support
On 04/29/2014 08:46 PM, Arnd Bergmann wrote: On Tuesday 29 April 2014 13:05:15 Ulf Hansson wrote: On 29 April 2014 11:45, Arnd Bergmann a...@arndb.de wrote: drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig I think the proper solution is to fix the dependency in the driver code instead. There are already some ifdefs hackery for making it optional to use leds, apparently that's not working properly. Ah, right, I misinterpreted the bug. Here is a new version: 8- From 5b5588f8c9b8ded8b296fd32d87b2d118e548a29 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann a...@arndb.de Date: Tue, 29 Apr 2014 11:41:40 +0200 Subject: [PATCH] mmc: rtsx: usb backend needs LED support Building the rtsx USB driver uses the LED classdev base support if available, but that fails if the classdev is a module and the MMC driver is built-in, leading to this link error. drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_remove': :(.text+0x806480): undefined reference to `led_classdev_unregister' drivers/built-in.o: In function `rtsx_usb_sdmmc_drv_probe': :(.text+0x806708): undefined reference to `led_classdev_register' This adds an explicit dependency in Kconfig to ensure that the MMC driver has to be a module if LEDS_CLASS is a module, but still allows it to be built-in if LEDS_CLASS is either disabled or built-in. Signed-off-by: Arnd Bergmann a...@arndb.de diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 92d91fe..68da9b8 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -696,6 +696,7 @@ config MMC_REALTEK_PCI config MMC_REALTEK_USB tristate Realtek USB SD/MMC Card Interface Driver depends on MFD_RTSX_USB + depends on m || LEDS_CLASS!=m help Say Y here to include driver code to support SD/MMC card interface of Realtek RTS5129/39 series card reader . I think Ulf's idea is to fix the bug by modifying the .c files. I really found the problem of my ifdef hackery and it should do something similar in sdhci.c as: From: Roger Tseng rogera...@realtek.com Date: Wed, 30 Apr 2014 11:11:25 +0800 Subject: [PATCH] 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 rogera...@realtek.com --- drivers/mmc/host/rtsx_usb_sdmmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index e11fafa..38bdda5 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 Best regards, Roger Tseng -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/