summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorweety <[email protected]>2017-10-19 19:14:06 +0800
committerweety <[email protected]>2017-10-19 19:14:06 +0800
commitdd5ac17fc8dc2c9dd166833b31ff08e7d9b316fb (patch)
tree380058c7af650a57aa287b5904d8198c8ae5a245 /components
parent121b72df71485fd2ce8dc8cebc5e71c764bb29c6 (diff)
[bsp][dm365] Using component initial;
[drv][mmcsd] Add component initial.
Diffstat (limited to 'components')
-rw-r--r--components/drivers/include/drivers/mmcsd_core.h4
-rw-r--r--components/drivers/sdio/block_dev.c6
-rw-r--r--components/drivers/sdio/mmcsd_core.c7
-rw-r--r--components/drivers/sdio/sdio.c7
4 files changed, 16 insertions, 8 deletions
diff --git a/components/drivers/include/drivers/mmcsd_core.h b/components/drivers/include/drivers/mmcsd_core.h
index e474fa28a8..36d71efeb2 100644
--- a/components/drivers/include/drivers/mmcsd_core.h
+++ b/components/drivers/include/drivers/mmcsd_core.h
@@ -247,9 +247,9 @@ void mmcsd_change(struct rt_mmcsd_host *host);
void mmcsd_detect(void *param);
struct rt_mmcsd_host *mmcsd_alloc_host(void);
void mmcsd_free_host(struct rt_mmcsd_host *host);
-void rt_mmcsd_core_init(void);
+int rt_mmcsd_core_init(void);
-void rt_mmcsd_blk_init(void);
+int rt_mmcsd_blk_init(void);
rt_int32_t rt_mmcsd_blk_probe(struct rt_mmcsd_card *card);
void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card);
diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c
index 3e142ee6e4..e6998f4fe3 100644
--- a/components/drivers/sdio/block_dev.c
+++ b/components/drivers/sdio/block_dev.c
@@ -479,7 +479,11 @@ void rt_mmcsd_blk_remove(struct rt_mmcsd_card *card)
* @deprecated since 2.1.0, this function does not need to be invoked
* in the system initialization.
*/
-void rt_mmcsd_blk_init(void)
+int rt_mmcsd_blk_init(void)
{
/* nothing */
+ return 0;
}
+
+INIT_PREV_EXPORT(rt_mmcsd_blk_init);
+
diff --git a/components/drivers/sdio/mmcsd_core.c b/components/drivers/sdio/mmcsd_core.c
index 02063efdd2..3e98444b71 100644
--- a/components/drivers/sdio/mmcsd_core.c
+++ b/components/drivers/sdio/mmcsd_core.c
@@ -655,6 +655,7 @@ void mmcsd_detect(void *param)
if (init_sd(host, ocr))
mmcsd_power_off(host);
mmcsd_host_unlock(host);
+ rt_mb_send(&mmcsd_hotpluge_mb, (rt_uint32_t)host);
continue;
}
@@ -726,7 +727,7 @@ void mmcsd_free_host(struct rt_mmcsd_host *host)
rt_free(host);
}
-void rt_mmcsd_core_init(void)
+int rt_mmcsd_core_init(void)
{
rt_err_t ret;
@@ -749,5 +750,9 @@ void rt_mmcsd_core_init(void)
}
rt_sdio_init();
+
+ return 0;
}
+INIT_PREV_EXPORT(rt_mmcsd_core_init);
+
diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c
index 496765854e..dc0cd1eb96 100644
--- a/components/drivers/sdio/sdio.c
+++ b/components/drivers/sdio/sdio.c
@@ -33,8 +33,8 @@
#define RT_SDIO_THREAD_PRIORITY 0x40
#endif
-static rt_list_t sdio_cards;
-static rt_list_t sdio_drivers;
+static rt_list_t sdio_cards = RT_LIST_OBJECT_INIT(sdio_cards);
+static rt_list_t sdio_drivers = RT_LIST_OBJECT_INIT(sdio_drivers);
struct sdio_card
{
@@ -1397,7 +1397,6 @@ rt_int32_t sdio_unregister_driver(struct rt_sdio_driver *driver)
void rt_sdio_init(void)
{
- rt_list_init(&sdio_cards);
- rt_list_init(&sdio_drivers);
+
}