From patchwork Thu May 8 08:27:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4133781 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40356BFF02 for ; Thu, 8 May 2014 08:28:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6AB8F2025B for ; Thu, 8 May 2014 08:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4170B201B4 for ; Thu, 8 May 2014 08:28:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbaEHI2K (ORCPT ); Thu, 8 May 2014 04:28:10 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:54429 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751552AbaEHI2J (ORCPT ); Thu, 8 May 2014 04:28:09 -0400 Received: from wuerfel.localnet (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MOiGM-1WnI212DCA-00645k; Thu, 08 May 2014 10:27:55 +0200 From: Arnd Bergmann To: Lee Jones Cc: Ulf Hansson , Samuel Ortiz , Greg Kroah-Hartman , Dan Carpenter , devel@linuxdriverproject.org, "linux-kernel@vger.kernel.org" , linux-mmc , Wei WANG , Roger Subject: [PATCH v2] mmc: rtsx: fix possible linking error if built-in Date: Thu, 08 May 2014 10:27:54 +0200 Message-ID: <4738962.LU0Ymo0veu@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.11.0-18-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V02:K0:zI3bz6/uCq0Z6Q8fAoLnhvHEVbcVfHLRKUCdkWU1vMf Rhy5xWOvCiUQOIjnejLy701URLIEahoetIF6UUuFFoEFYpaaBX I93ELC0mQNI6DQmNaXSLYNPs48vWRwP1/EIe8qlTC6+Jf8bM5h cU+hIKcX3OjosZdgk5L2Fw6uUgzr4sLgtnF34YeJ0N6KRDq4Pq vwezg2x3NnDn7gzW2NEXDEQuwgMSq3KnW8FksyhQet4By4fNdu 2F7GVD7PlNGpD4q78D+MLa4kVXVIrDXZ+Z7WpuhJD+lxJ75o3B BDhUlN+0N/i71785Pyr06alPaKpULxPEZSj//NyDk80CJHNelz Zjt27v9mlhfPmJDmZBOc= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Arnd Bergmann Acked-by: Ulf Hansson --- v2 by Arnd: change the second #ifdef as well. -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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 #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 @@ -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;