]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mmc: core: First step in cleaning up private mmc header files
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 13 Jan 2017 13:14:07 +0000 (14:14 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 13 Feb 2017 12:20:20 +0000 (13:20 +0100)
This is the first step in cleaning up the private 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>
13 files changed:
drivers/mmc/core/block.h
drivers/mmc/core/bus.h
drivers/mmc/core/core.h
drivers/mmc/core/host.h
drivers/mmc/core/mmc_ops.h
drivers/mmc/core/pwrseq.h
drivers/mmc/core/queue.h
drivers/mmc/core/sd.h
drivers/mmc/core/sd_ops.h
drivers/mmc/core/sdio_bus.h
drivers/mmc/core/sdio_cis.h
drivers/mmc/core/sdio_ops.h
drivers/mmc/core/slot-gpio.h

index cdabb2ee74be9498a30ec04b918fe6197dab9fd8..00b7483f2d6e1b214bb074ba32d92b663ff5dd44 100644 (file)
@@ -1 +1,9 @@
+#ifndef _MMC_CORE_BLOCK_H
+#define _MMC_CORE_BLOCK_H
+
+struct mmc_queue;
+struct request;
+
 int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req);
+
+#endif
index 00a19710b6b449500b613c316c8b167977ba9cb9..93b516ab6e887bb0afd71538ef8071a9234b65b3 100644 (file)
 #ifndef _MMC_CORE_BUS_H
 #define _MMC_CORE_BUS_H
 
+struct mmc_host;
+struct mmc_card;
+struct device_type;
+
 #define MMC_DEV_ATTR(name, fmt, args...)                                       \
 static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf)        \
 {                                                                              \
index 0fa86a2afc265e7224520f22892e12cfc652a2e2..29b91aea7878fd4ba0d5d01003e8816c69f92de6 100644 (file)
 #define _MMC_CORE_CORE_H
 
 #include <linux/delay.h>
+#include <linux/sched.h>
+
+struct mmc_host;
+struct mmc_card;
 
 #define MMC_CMD_RETRIES        3
 
index 992bf53976337f0edf3f64fe4f9a007f4693b3a6..366ce79c3498a82a3d0c97452a9f6d07ce217346 100644 (file)
@@ -10,7 +10,8 @@
  */
 #ifndef _MMC_CORE_HOST_H
 #define _MMC_CORE_HOST_H
-#include <linux/mmc/host.h>
+
+struct mmc_host;
 
 int mmc_register_host_class(void);
 void mmc_unregister_host_class(void);
index abd525ed74be37b4fb3d1a4bdfeb770f835061f4..e76365aa958777d47ac5768e20e43f35ae0ec4cf 100644 (file)
 #ifndef _MMC_MMC_OPS_H
 #define _MMC_MMC_OPS_H
 
+#include <linux/types.h>
+
+struct mmc_host;
+struct mmc_card;
+
 int mmc_select_card(struct mmc_card *card);
 int mmc_deselect_cards(struct mmc_host *host);
 int mmc_set_dsr(struct mmc_host *host);
index d69e751f148b85f26d89e748a51c0486d215695c..39c911aa6ebba3204b52c93f857cfe2e9c9bdaf9 100644 (file)
@@ -8,7 +8,11 @@
 #ifndef _MMC_CORE_PWRSEQ_H
 #define _MMC_CORE_PWRSEQ_H
 
-#include <linux/mmc/host.h>
+#include <linux/types.h>
+
+struct mmc_host;
+struct device;
+struct module;
 
 struct mmc_pwrseq_ops {
        void (*pre_power_on)(struct mmc_host *host);
index dac8c3d010dd9615a576256ec45b2dd7cef5a6f2..0cea02af79d1702bad4ab9b1beb036173035ad4f 100644 (file)
@@ -1,6 +1,11 @@
 #ifndef MMC_QUEUE_H
 #define MMC_QUEUE_H
 
+#include <linux/types.h>
+#include <linux/blkdev.h>
+#include <linux/mmc/core.h>
+#include <linux/mmc/host.h>
+
 static inline bool mmc_req_is_special(struct request *req)
 {
        return req &&
@@ -9,7 +14,6 @@ static inline bool mmc_req_is_special(struct request *req)
                 req_op(req) == REQ_OP_SECURE_ERASE);
 }
 
-struct request;
 struct task_struct;
 struct mmc_blk_data;
 
index aab824a9a7f369b858b663797807c07088b29142..1ada9808c3296921c4b3dff5424482a3ad86327d 100644 (file)
@@ -1,10 +1,13 @@
 #ifndef _MMC_CORE_SD_H
 #define _MMC_CORE_SD_H
 
-#include <linux/mmc/card.h>
+#include <linux/types.h>
 
 extern struct device_type sd_type;
 
+struct mmc_host;
+struct mmc_card;
+
 int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr);
 int mmc_sd_get_csd(struct mmc_host *host, struct mmc_card *card);
 void mmc_decode_cid(struct mmc_card *card);
index ffc2305d905fcc2c121a0d32a171846d835ec41b..ac7223cf33e3d6ad0417db850bde9fa07e38f72d 100644 (file)
 #ifndef _MMC_SD_OPS_H
 #define _MMC_SD_OPS_H
 
+#include <linux/types.h>
+
+struct mmc_card;
+struct mmc_host;
+
 int mmc_app_set_bus_width(struct mmc_card *card, int width);
 int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
 int mmc_send_if_cond(struct mmc_host *host, u32 ocr);
index 567a76821ba77d6ef4b5a9df3333c9becb265994..b69a2540a076f6dac50233f83a686bb93371d7b3 100644 (file)
@@ -11,6 +11,9 @@
 #ifndef _MMC_CORE_SDIO_BUS_H
 #define _MMC_CORE_SDIO_BUS_H
 
+struct mmc_card;
+struct sdio_func;
+
 struct sdio_func *sdio_alloc_func(struct mmc_card *card);
 int sdio_add_func(struct sdio_func *func);
 void sdio_remove_func(struct sdio_func *func);
index 4d903c2e425e029ddea616dbfacc8d6dc7c90393..16aa563faa00733f2568acabac6aeb7e85973b18 100644 (file)
@@ -14,6 +14,9 @@
 #ifndef _MMC_SDIO_CIS_H
 #define _MMC_SDIO_CIS_H
 
+struct mmc_card;
+struct sdio_func;
+
 int sdio_read_common_cis(struct mmc_card *card);
 void sdio_free_common_cis(struct mmc_card *card);
 
index 5660c7f459e94731b14a5055e9aab3fbb79ec3b1..e1c36d64572c2228ee860f837bb542ac71250726 100644 (file)
 #ifndef _MMC_SDIO_OPS_H
 #define _MMC_SDIO_OPS_H
 
+#include <linux/types.h>
 #include <linux/mmc/sdio.h>
 
+struct mmc_host;
+struct mmc_card;
+
 int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
 int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
        unsigned addr, u8 in, u8* out);
index 8c1854dc5d588d44b0b506040728bda07f55e628..a06fd843f0256624dac7a20203477a383415b0f2 100644 (file)
@@ -8,6 +8,8 @@
 #ifndef _MMC_CORE_SLOTGPIO_H
 #define _MMC_CORE_SLOTGPIO_H
 
+struct mmc_host;
+
 int mmc_gpio_alloc(struct mmc_host *host);
 
 #endif