diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2008-12-21 11:01:48 -0500 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-12-31 12:18:13 -0500 |
commit | f9134319c81c6c56e0ddf38e7adac2492b243d9b (patch) | |
tree | 953e14c5d264a8283c39b859c2dd1bde52f36fa8 /drivers/mmc | |
parent | ca4f10563929b932ed8970fda41a7f99385e4b0b (diff) |
sdhci: handle built-in sdhci with modular leds class
As reported by Randy Dunlap, having sdhci built-in and LEDs class
as a module resulted in undefined symbols. Change the code to handle
that case properly (by not having LEDs class support in sdhci).
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 3b1b54f9b0fe..6b2d1f99af67 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -30,6 +30,11 @@ | |||
30 | #define DBG(f, x...) \ | 30 | #define DBG(f, x...) \ |
31 | pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) | 31 | pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) |
32 | 32 | ||
33 | #if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \ | ||
34 | defined(CONFIG_MMC_SDHCI_MODULE)) | ||
35 | #define SDHCI_USE_LEDS_CLASS | ||
36 | #endif | ||
37 | |||
33 | static unsigned int debug_quirks = 0; | 38 | static unsigned int debug_quirks = 0; |
34 | 39 | ||
35 | static void sdhci_prepare_data(struct sdhci_host *, struct mmc_data *); | 40 | static void sdhci_prepare_data(struct sdhci_host *, struct mmc_data *); |
@@ -149,7 +154,7 @@ static void sdhci_deactivate_led(struct sdhci_host *host) | |||
149 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); | 154 | writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL); |
150 | } | 155 | } |
151 | 156 | ||
152 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | 157 | #ifdef SDHCI_USE_LEDS_CLASS |
153 | static void sdhci_led_control(struct led_classdev *led, | 158 | static void sdhci_led_control(struct led_classdev *led, |
154 | enum led_brightness brightness) | 159 | enum led_brightness brightness) |
155 | { | 160 | { |
@@ -994,7 +999,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
994 | 999 | ||
995 | WARN_ON(host->mrq != NULL); | 1000 | WARN_ON(host->mrq != NULL); |
996 | 1001 | ||
997 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | 1002 | #ifndef SDHCI_USE_LEDS_CLASS |
998 | sdhci_activate_led(host); | 1003 | sdhci_activate_led(host); |
999 | #endif | 1004 | #endif |
1000 | 1005 | ||
@@ -1201,7 +1206,7 @@ static void sdhci_tasklet_finish(unsigned long param) | |||
1201 | host->cmd = NULL; | 1206 | host->cmd = NULL; |
1202 | host->data = NULL; | 1207 | host->data = NULL; |
1203 | 1208 | ||
1204 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | 1209 | #ifndef SDHCI_USE_LEDS_CLASS |
1205 | sdhci_deactivate_led(host); | 1210 | sdhci_deactivate_led(host); |
1206 | #endif | 1211 | #endif |
1207 | 1212 | ||
@@ -1717,7 +1722,7 @@ int sdhci_add_host(struct sdhci_host *host) | |||
1717 | sdhci_dumpregs(host); | 1722 | sdhci_dumpregs(host); |
1718 | #endif | 1723 | #endif |
1719 | 1724 | ||
1720 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | 1725 | #ifdef SDHCI_USE_LEDS_CLASS |
1721 | host->led.name = mmc_hostname(mmc); | 1726 | host->led.name = mmc_hostname(mmc); |
1722 | host->led.brightness = LED_OFF; | 1727 | host->led.brightness = LED_OFF; |
1723 | host->led.default_trigger = mmc_hostname(mmc); | 1728 | host->led.default_trigger = mmc_hostname(mmc); |
@@ -1739,7 +1744,7 @@ int sdhci_add_host(struct sdhci_host *host) | |||
1739 | 1744 | ||
1740 | return 0; | 1745 | return 0; |
1741 | 1746 | ||
1742 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | 1747 | #ifdef SDHCI_USE_LEDS_CLASS |
1743 | reset: | 1748 | reset: |
1744 | sdhci_reset(host, SDHCI_RESET_ALL); | 1749 | sdhci_reset(host, SDHCI_RESET_ALL); |
1745 | free_irq(host->irq, host); | 1750 | free_irq(host->irq, host); |
@@ -1775,7 +1780,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) | |||
1775 | 1780 | ||
1776 | mmc_remove_host(host->mmc); | 1781 | mmc_remove_host(host->mmc); |
1777 | 1782 | ||
1778 | #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | 1783 | #ifdef SDHCI_USE_LEDS_CLASS |
1779 | led_classdev_unregister(&host->led); | 1784 | led_classdev_unregister(&host->led); |
1780 | #endif | 1785 | #endif |
1781 | 1786 | ||