Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
[firefly-linux-kernel-4.4.55.git] / drivers / mmc / core / host.c
index fcf7829c759e200baa7ef5f9cd456c18dd83ac48..443fdfc22d8a7ec5783ab28410b28c81feec8806 100644 (file)
@@ -32,8 +32,6 @@
 #include "slot-gpio.h"
 #include "pwrseq.h"
 
-#define cls_dev_to_mmc_host(d) container_of(d, struct mmc_host, class_dev)
-
 static DEFINE_IDR(mmc_host_idr);
 static DEFINE_SPINLOCK(mmc_host_lock);
 
@@ -394,6 +392,10 @@ int mmc_add_host(struct mmc_host *host)
        mmc_add_host_debugfs(host);
 #endif
 
+#ifdef CONFIG_BLOCK
+       mmc_latency_hist_sysfs_init(host);
+#endif
+
        mmc_start_host(host);
        if (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY))
                register_pm_notifier(&host->pm_notify);
@@ -422,6 +424,10 @@ void mmc_remove_host(struct mmc_host *host)
        mmc_remove_host_debugfs(host);
 #endif
 
+#ifdef CONFIG_BLOCK
+       mmc_latency_hist_sysfs_exit(host);
+#endif
+
        device_del(&host->class_dev);
 
        led_trigger_unregister_simple(host->led);