]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mmc: core: First step in cleaning up public mmc header files
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 13 Jan 2017 13:14:06 +0000 (14:14 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 13 Feb 2017 12:20:19 +0000 (13:20 +0100)
This is the first step in cleaning up the public mmc header files. In this
change we makes sure each header file builds standalone, as that helps to
resolve dependencies.

While changing this, it also seems reasonable to stop including other
headers from inside a header itself which it don't depend upon.
Additionally, in some cases such dependencies are better resolved by
forward declaring the needed struct.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
include/linux/mmc/card.h
include/linux/mmc/core.h
include/linux/mmc/host.h
include/linux/mmc/mmc.h
include/linux/mmc/slot-gpio.h

index 00449e51838ab28f392ac92fe7898256a083417a..ca64f5b67983ae35b9bd05b117cddba93d7c0fc4 100644 (file)
@@ -11,7 +11,6 @@
 #define LINUX_MMC_CARD_H
 
 #include <linux/device.h>
-#include <linux/mmc/core.h>
 #include <linux/mod_devicetable.h>
 
 struct mmc_cid {
@@ -206,7 +205,6 @@ struct sdio_cis {
 };
 
 struct mmc_host;
-struct mmc_ios;
 struct sdio_func;
 struct sdio_func_tuple;
 
index e33cc748dcfe16e65d20ea6f815ca365deb0b2db..64e2ddf33f386b1a1e599cb6d438a3cd3edf3a25 100644 (file)
@@ -8,10 +8,9 @@
 #ifndef LINUX_MMC_CORE_H
 #define LINUX_MMC_CORE_H
 
-#include <linux/interrupt.h>
 #include <linux/completion.h>
+#include <linux/types.h>
 
-struct request;
 struct mmc_data;
 struct mmc_request;
 
index 8bc8841214653c0c39d7c9e1030f6cc9b72fe78c..8d38c76b06d65ef899f9c1821e7855337ad85134 100644 (file)
 #ifndef LINUX_MMC_HOST_H
 #define LINUX_MMC_HOST_H
 
-#include <linux/leds.h>
-#include <linux/mutex.h>
-#include <linux/timer.h>
 #include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/fault-inject.h>
 
 #include <linux/mmc/core.h>
 #include <linux/mmc/card.h>
-#include <linux/mmc/mmc.h>
 #include <linux/mmc/pm.h>
 
 struct mmc_ios {
@@ -82,6 +78,8 @@ struct mmc_ios {
        bool enhanced_strobe;                   /* hs400es selection */
 };
 
+struct mmc_host;
+
 struct mmc_host_ops {
        /*
         * It is optional for the host to implement pre_req and post_req in
@@ -162,9 +160,6 @@ struct mmc_host_ops {
                                  unsigned int direction, int blk_size);
 };
 
-struct mmc_card;
-struct device;
-
 struct mmc_async_req {
        /* active mmc request */
        struct mmc_request      *mrq;
index a0740829ff0048532886ff04cd2f2906f17c3d58..261772e3effea79b620e1cfa4e2a97b8b1cf5bb0 100644 (file)
@@ -24,6 +24,8 @@
 #ifndef LINUX_MMC_MMC_H
 #define LINUX_MMC_MMC_H
 
+#include <linux/types.h>
+
 /* Standard MMC commands (4.1)           type  argument     response */
    /* class 1 */
 #define MMC_GO_IDLE_STATE         0   /* bc                          */
index a7972cd3bc149bae8b5d59d06256244491361c1a..82f0d289f110333696d8c0aa1f9b1c7f15adc556 100644 (file)
@@ -11,6 +11,9 @@
 #ifndef MMC_SLOT_GPIO_H
 #define MMC_SLOT_GPIO_H
 
+#include <linux/types.h>
+#include <linux/irqreturn.h>
+
 struct mmc_host;
 
 int mmc_gpio_get_ro(struct mmc_host *host);