Fix a build breakage in IO latency hist code.
authorMohan Srinivasan <srmohan@google.com>
Mon, 3 Oct 2016 23:17:34 +0000 (16:17 -0700)
committerMohan Srinivasan <srmohan@google.com>
Tue, 4 Oct 2016 21:17:25 +0000 (21:17 +0000)
Fix a build breakage where MMC is enabled, but BLOCK is not.

Change-Id: I0eb422d12264f0371f3368ae7c37342ef9efabaa
Signed-off-by: Mohan Srinivasan <srmohan@google.com>
drivers/mmc/core/core.c
drivers/mmc/core/host.c
include/linux/mmc/core.h

index b503249950df694f8a155e0ca9a809c8ce70edff..f9d928cbc214e96e7a1b5b7d5c78eefc85e637e0 100644 (file)
@@ -183,6 +183,7 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
                        pr_debug("%s:     %d bytes transferred: %d\n",
                                mmc_hostname(host),
                                mrq->data->bytes_xfered, mrq->data->error);
+#ifdef CONFIG_BLOCK
                        if (mrq->lat_hist_enabled) {
                                ktime_t completion;
                                u_int64_t delta_us;
@@ -194,6 +195,7 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
                                        (mrq->data->flags & MMC_DATA_READ),
                                        delta_us);
                        }
+#endif
                        trace_mmc_blk_rw_end(cmd->opcode, cmd->arg, mrq->data);
                }
 
@@ -638,11 +640,13 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host,
        }
 
        if (!err && areq) {
+#ifdef CONFIG_BLOCK
                if (host->latency_hist_enabled) {
                        areq->mrq->io_start = ktime_get();
                        areq->mrq->lat_hist_enabled = 1;
                } else
                        areq->mrq->lat_hist_enabled = 0;
+#endif
                trace_mmc_blk_rw_start(areq->mrq->cmd->opcode,
                                       areq->mrq->cmd->arg,
                                       areq->mrq->data);
@@ -2923,6 +2927,7 @@ static void __exit mmc_exit(void)
        destroy_workqueue(workqueue);
 }
 
+#ifdef CONFIG_BLOCK
 static ssize_t
 latency_hist_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
@@ -2970,6 +2975,7 @@ mmc_latency_hist_sysfs_exit(struct mmc_host *host)
 {
        device_remove_file(&host->class_dev, &dev_attr_latency_hist);
 }
+#endif
 
 subsys_initcall(mmc_init);
 module_exit(mmc_exit);
index 17068839c74b40cee6c16f0e1487fc37b4ed1759..443fdfc22d8a7ec5783ab28410b28c81feec8806 100644 (file)
@@ -392,7 +392,9 @@ 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))
@@ -422,7 +424,9 @@ 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);
 
index 3349f0676acb864ea6e25e30e79d9c1fcb43bfaa..0860efd6e1bedd32710f0528ee2f888111e1f528 100644 (file)
@@ -137,7 +137,9 @@ struct mmc_request {
        void                    (*done)(struct mmc_request *);/* completion function */
        struct mmc_host         *host;
        ktime_t                 io_start;
+#ifdef CONFIG_BLOCK
        int                     lat_hist_enabled;
+#endif
 };
 
 struct mmc_card;