diff options
Diffstat (limited to 'drivers/mmc/core/host.c')
-rw-r--r-- | drivers/mmc/core/host.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 2c7ce8f43a9a..c65d203a846d 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -15,6 +15,7 @@ #include <linux/err.h> #include <linux/idr.h> #include <linux/pagemap.h> +#include <linux/leds.h> #include <linux/mmc/host.h> @@ -100,6 +101,9 @@ int mmc_add_host(struct mmc_host *host) { int err; + WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) && + !host->ops->enable_sdio_irq); + if (!idr_pre_get(&mmc_host_idr, GFP_KERNEL)) return -ENOMEM; @@ -112,6 +116,8 @@ int mmc_add_host(struct mmc_host *host) snprintf(host->class_dev.bus_id, BUS_ID_SIZE, "mmc%d", host->index); + led_trigger_register_simple(host->class_dev.bus_id, &host->led); + err = device_add(&host->class_dev); if (err) return err; @@ -137,6 +143,8 @@ void mmc_remove_host(struct mmc_host *host) device_del(&host->class_dev); + led_trigger_unregister_simple(host->led); + spin_lock(&mmc_host_lock); idr_remove(&mmc_host_idr, host->index); spin_unlock(&mmc_host_lock); |