aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2017-01-13 08:14:07 -0500
committerUlf Hansson <ulf.hansson@linaro.org>2017-02-13 07:20:20 -0500
commit066185d690631478b16045d152b163a51a5e4847 (patch)
tree2d72d5f38ef8400a46f421dd3fcbd8fdbd454c98
parent8da007348bf52a91e5137d27d7dcd528edbb80ce (diff)
mmc: core: First step in cleaning up private mmc header files
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>
-rw-r--r--drivers/mmc/core/block.h8
-rw-r--r--drivers/mmc/core/bus.h4
-rw-r--r--drivers/mmc/core/core.h4
-rw-r--r--drivers/mmc/core/host.h3
-rw-r--r--drivers/mmc/core/mmc_ops.h5
-rw-r--r--drivers/mmc/core/pwrseq.h6
-rw-r--r--drivers/mmc/core/queue.h6
-rw-r--r--drivers/mmc/core/sd.h5
-rw-r--r--drivers/mmc/core/sd_ops.h5
-rw-r--r--drivers/mmc/core/sdio_bus.h3
-rw-r--r--drivers/mmc/core/sdio_cis.h3
-rw-r--r--drivers/mmc/core/sdio_ops.h4
-rw-r--r--drivers/mmc/core/slot-gpio.h2
13 files changed, 54 insertions, 4 deletions
diff --git a/drivers/mmc/core/block.h b/drivers/mmc/core/block.h
index cdabb2ee74be..00b7483f2d6e 100644
--- a/drivers/mmc/core/block.h
+++ b/drivers/mmc/core/block.h
@@ -1 +1,9 @@
1#ifndef _MMC_CORE_BLOCK_H
2#define _MMC_CORE_BLOCK_H
3
4struct mmc_queue;
5struct request;
6
1int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req); 7int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req);
8
9#endif
diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h
index 00a19710b6b4..93b516ab6e88 100644
--- a/drivers/mmc/core/bus.h
+++ b/drivers/mmc/core/bus.h
@@ -11,6 +11,10 @@
11#ifndef _MMC_CORE_BUS_H 11#ifndef _MMC_CORE_BUS_H
12#define _MMC_CORE_BUS_H 12#define _MMC_CORE_BUS_H
13 13
14struct mmc_host;
15struct mmc_card;
16struct device_type;
17
14#define MMC_DEV_ATTR(name, fmt, args...) \ 18#define MMC_DEV_ATTR(name, fmt, args...) \
15static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ 19static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
16{ \ 20{ \
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 0fa86a2afc26..29b91aea7878 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -12,6 +12,10 @@
12#define _MMC_CORE_CORE_H 12#define _MMC_CORE_CORE_H
13 13
14#include <linux/delay.h> 14#include <linux/delay.h>
15#include <linux/sched.h>
16
17struct mmc_host;
18struct mmc_card;
15 19
16#define MMC_CMD_RETRIES 3 20#define MMC_CMD_RETRIES 3
17 21
diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h
index 992bf5397633..366ce79c3498 100644
--- a/drivers/mmc/core/host.h
+++ b/drivers/mmc/core/host.h
@@ -10,7 +10,8 @@
10 */ 10 */
11#ifndef _MMC_CORE_HOST_H 11#ifndef _MMC_CORE_HOST_H
12#define _MMC_CORE_HOST_H 12#define _MMC_CORE_HOST_H
13#include <linux/mmc/host.h> 13
14struct mmc_host;
14 15
15int mmc_register_host_class(void); 16int mmc_register_host_class(void);
16void mmc_unregister_host_class(void); 17void mmc_unregister_host_class(void);
diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
index abd525ed74be..e76365aa9587 100644
--- a/drivers/mmc/core/mmc_ops.h
+++ b/drivers/mmc/core/mmc_ops.h
@@ -12,6 +12,11 @@
12#ifndef _MMC_MMC_OPS_H 12#ifndef _MMC_MMC_OPS_H
13#define _MMC_MMC_OPS_H 13#define _MMC_MMC_OPS_H
14 14
15#include <linux/types.h>
16
17struct mmc_host;
18struct mmc_card;
19
15int mmc_select_card(struct mmc_card *card); 20int mmc_select_card(struct mmc_card *card);
16int mmc_deselect_cards(struct mmc_host *host); 21int mmc_deselect_cards(struct mmc_host *host);
17int mmc_set_dsr(struct mmc_host *host); 22int mmc_set_dsr(struct mmc_host *host);
diff --git a/drivers/mmc/core/pwrseq.h b/drivers/mmc/core/pwrseq.h
index d69e751f148b..39c911aa6ebb 100644
--- a/drivers/mmc/core/pwrseq.h
+++ b/drivers/mmc/core/pwrseq.h
@@ -8,7 +8,11 @@
8#ifndef _MMC_CORE_PWRSEQ_H 8#ifndef _MMC_CORE_PWRSEQ_H
9#define _MMC_CORE_PWRSEQ_H 9#define _MMC_CORE_PWRSEQ_H
10 10
11#include <linux/mmc/host.h> 11#include <linux/types.h>
12
13struct mmc_host;
14struct device;
15struct module;
12 16
13struct mmc_pwrseq_ops { 17struct mmc_pwrseq_ops {
14 void (*pre_power_on)(struct mmc_host *host); 18 void (*pre_power_on)(struct mmc_host *host);
diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h
index dac8c3d010dd..0cea02af79d1 100644
--- a/drivers/mmc/core/queue.h
+++ b/drivers/mmc/core/queue.h
@@ -1,6 +1,11 @@
1#ifndef MMC_QUEUE_H 1#ifndef MMC_QUEUE_H
2#define MMC_QUEUE_H 2#define MMC_QUEUE_H
3 3
4#include <linux/types.h>
5#include <linux/blkdev.h>
6#include <linux/mmc/core.h>
7#include <linux/mmc/host.h>
8
4static inline bool mmc_req_is_special(struct request *req) 9static inline bool mmc_req_is_special(struct request *req)
5{ 10{
6 return req && 11 return req &&
@@ -9,7 +14,6 @@ static inline bool mmc_req_is_special(struct request *req)
9 req_op(req) == REQ_OP_SECURE_ERASE); 14 req_op(req) == REQ_OP_SECURE_ERASE);
10} 15}
11 16
12struct request;
13struct task_struct; 17struct task_struct;
14struct mmc_blk_data; 18struct mmc_blk_data;
15 19
diff --git a/drivers/mmc/core/sd.h b/drivers/mmc/core/sd.h
index aab824a9a7f3..1ada9808c329 100644
--- a/drivers/mmc/core/sd.h
+++ b/drivers/mmc/core/sd.h
@@ -1,10 +1,13 @@
1#ifndef _MMC_CORE_SD_H 1#ifndef _MMC_CORE_SD_H
2#define _MMC_CORE_SD_H 2#define _MMC_CORE_SD_H
3 3
4#include <linux/mmc/card.h> 4#include <linux/types.h>
5 5
6extern struct device_type sd_type; 6extern struct device_type sd_type;
7 7
8struct mmc_host;
9struct mmc_card;
10
8int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr); 11int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr);
9int mmc_sd_get_csd(struct mmc_host *host, struct mmc_card *card); 12int mmc_sd_get_csd(struct mmc_host *host, struct mmc_card *card);
10void mmc_decode_cid(struct mmc_card *card); 13void mmc_decode_cid(struct mmc_card *card);
diff --git a/drivers/mmc/core/sd_ops.h b/drivers/mmc/core/sd_ops.h
index ffc2305d905f..ac7223cf33e3 100644
--- a/drivers/mmc/core/sd_ops.h
+++ b/drivers/mmc/core/sd_ops.h
@@ -12,6 +12,11 @@
12#ifndef _MMC_SD_OPS_H 12#ifndef _MMC_SD_OPS_H
13#define _MMC_SD_OPS_H 13#define _MMC_SD_OPS_H
14 14
15#include <linux/types.h>
16
17struct mmc_card;
18struct mmc_host;
19
15int mmc_app_set_bus_width(struct mmc_card *card, int width); 20int mmc_app_set_bus_width(struct mmc_card *card, int width);
16int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr); 21int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
17int mmc_send_if_cond(struct mmc_host *host, u32 ocr); 22int mmc_send_if_cond(struct mmc_host *host, u32 ocr);
diff --git a/drivers/mmc/core/sdio_bus.h b/drivers/mmc/core/sdio_bus.h
index 567a76821ba7..b69a2540a076 100644
--- a/drivers/mmc/core/sdio_bus.h
+++ b/drivers/mmc/core/sdio_bus.h
@@ -11,6 +11,9 @@
11#ifndef _MMC_CORE_SDIO_BUS_H 11#ifndef _MMC_CORE_SDIO_BUS_H
12#define _MMC_CORE_SDIO_BUS_H 12#define _MMC_CORE_SDIO_BUS_H
13 13
14struct mmc_card;
15struct sdio_func;
16
14struct sdio_func *sdio_alloc_func(struct mmc_card *card); 17struct sdio_func *sdio_alloc_func(struct mmc_card *card);
15int sdio_add_func(struct sdio_func *func); 18int sdio_add_func(struct sdio_func *func);
16void sdio_remove_func(struct sdio_func *func); 19void sdio_remove_func(struct sdio_func *func);
diff --git a/drivers/mmc/core/sdio_cis.h b/drivers/mmc/core/sdio_cis.h
index 4d903c2e425e..16aa563faa00 100644
--- a/drivers/mmc/core/sdio_cis.h
+++ b/drivers/mmc/core/sdio_cis.h
@@ -14,6 +14,9 @@
14#ifndef _MMC_SDIO_CIS_H 14#ifndef _MMC_SDIO_CIS_H
15#define _MMC_SDIO_CIS_H 15#define _MMC_SDIO_CIS_H
16 16
17struct mmc_card;
18struct sdio_func;
19
17int sdio_read_common_cis(struct mmc_card *card); 20int sdio_read_common_cis(struct mmc_card *card);
18void sdio_free_common_cis(struct mmc_card *card); 21void sdio_free_common_cis(struct mmc_card *card);
19 22
diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h
index 5660c7f459e9..e1c36d64572c 100644
--- a/drivers/mmc/core/sdio_ops.h
+++ b/drivers/mmc/core/sdio_ops.h
@@ -12,8 +12,12 @@
12#ifndef _MMC_SDIO_OPS_H 12#ifndef _MMC_SDIO_OPS_H
13#define _MMC_SDIO_OPS_H 13#define _MMC_SDIO_OPS_H
14 14
15#include <linux/types.h>
15#include <linux/mmc/sdio.h> 16#include <linux/mmc/sdio.h>
16 17
18struct mmc_host;
19struct mmc_card;
20
17int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr); 21int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
18int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn, 22int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
19 unsigned addr, u8 in, u8* out); 23 unsigned addr, u8 in, u8* out);
diff --git a/drivers/mmc/core/slot-gpio.h b/drivers/mmc/core/slot-gpio.h
index 8c1854dc5d58..a06fd843f025 100644
--- a/drivers/mmc/core/slot-gpio.h
+++ b/drivers/mmc/core/slot-gpio.h
@@ -8,6 +8,8 @@
8#ifndef _MMC_CORE_SLOTGPIO_H 8#ifndef _MMC_CORE_SLOTGPIO_H
9#define _MMC_CORE_SLOTGPIO_H 9#define _MMC_CORE_SLOTGPIO_H
10 10
11struct mmc_host;
12
11int mmc_gpio_alloc(struct mmc_host *host); 13int mmc_gpio_alloc(struct mmc_host *host);
12 14
13#endif 15#endif