include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / mmc / core / host.c
index 1d795c5..4735390 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/idr.h>
 #include <linux/pagemap.h>
 #include <linux/leds.h>
+#include <linux/slab.h>
 
 #include <linux/mmc/host.h>
 
@@ -73,8 +74,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
        if (err)
                goto free;
 
-       snprintf(host->class_dev.bus_id, BUS_ID_SIZE,
-                "mmc%d", host->index);
+       dev_set_name(&host->class_dev, "mmc%d", host->index);
 
        host->parent = dev;
        host->class_dev.parent = dev;
@@ -84,6 +84,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
        spin_lock_init(&host->lock);
        init_waitqueue_head(&host->wq);
        INIT_DELAYED_WORK(&host->detect, mmc_rescan);
+       INIT_DELAYED_WORK_DEFERRABLE(&host->disable, mmc_host_deeper_disable);
 
        /*
         * By default, hosts do not support SGIO or large requests.
@@ -121,12 +122,16 @@ int mmc_add_host(struct mmc_host *host)
        WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
                !host->ops->enable_sdio_irq);
 
-       led_trigger_register_simple(host->class_dev.bus_id, &host->led);
+       led_trigger_register_simple(dev_name(&host->class_dev), &host->led);
 
        err = device_add(&host->class_dev);
        if (err)
                return err;
 
+#ifdef CONFIG_DEBUG_FS
+       mmc_add_host_debugfs(host);
+#endif
+
        mmc_start_host(host);
 
        return 0;
@@ -146,6 +151,10 @@ void mmc_remove_host(struct mmc_host *host)
 {
        mmc_stop_host(host);
 
+#ifdef CONFIG_DEBUG_FS
+       mmc_remove_host_debugfs(host);
+#endif
+
        device_del(&host->class_dev);
 
        led_trigger_unregister_simple(host->led);