Skip to content

Commit

Permalink
sdhci: activate led support also when module
Browse files Browse the repository at this point in the history
CONFIG_LEDS_CLASS is defined only if led-class is built-in, otherwise
when it is a module the option is called CONFIG_LEDS_CLASS_MODULE. Led
support should also be activated in this case.

Signed-off-by: Eric Piel <[email protected]>
Signed-off-by: Pierre Ossman <[email protected]>
  • Loading branch information
pieleric authored and Pierre Ossman committed Dec 31, 2008
1 parent b7a0321 commit 35ff855
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static void sdhci_deactivate_led(struct sdhci_host *host)
writeb(ctrl, host->ioaddr + SDHCI_HOST_CONTROL);
}

#ifdef CONFIG_LEDS_CLASS
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
static void sdhci_led_control(struct led_classdev *led,
enum led_brightness brightness)
{
Expand Down Expand Up @@ -994,7 +994,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)

WARN_ON(host->mrq != NULL);

#ifndef CONFIG_LEDS_CLASS
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
sdhci_activate_led(host);
#endif

Expand Down Expand Up @@ -1201,7 +1201,7 @@ static void sdhci_tasklet_finish(unsigned long param)
host->cmd = NULL;
host->data = NULL;

#ifndef CONFIG_LEDS_CLASS
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
sdhci_deactivate_led(host);
#endif

Expand Down Expand Up @@ -1717,7 +1717,7 @@ int sdhci_add_host(struct sdhci_host *host)
sdhci_dumpregs(host);
#endif

#ifdef CONFIG_LEDS_CLASS
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
host->led.name = mmc_hostname(mmc);
host->led.brightness = LED_OFF;
host->led.default_trigger = mmc_hostname(mmc);
Expand All @@ -1739,7 +1739,7 @@ int sdhci_add_host(struct sdhci_host *host)

return 0;

#ifdef CONFIG_LEDS_CLASS
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
reset:
sdhci_reset(host, SDHCI_RESET_ALL);
free_irq(host->irq, host);
Expand Down Expand Up @@ -1775,7 +1775,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead)

mmc_remove_host(host->mmc);

#ifdef CONFIG_LEDS_CLASS
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
led_classdev_unregister(&host->led);
#endif

Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/host/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ struct sdhci_host {
struct mmc_host *mmc; /* MMC structure */
u64 dma_mask; /* custom DMA mask */

#ifdef CONFIG_LEDS_CLASS
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
struct led_classdev led; /* LED control */
#endif

Expand Down

0 comments on commit 35ff855

Please sign in to comment.