From 540d6ebf547f73facd541d6db21e733929f7e525 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 13 Aug 2015 11:16:20 +0800 Subject: [PATCH] [DeviceDrivers] Fix sdio drv issue --- components/drivers/include/drivers/sdio.h | 6 ++++++ components/drivers/sdio/block_dev.c | 2 +- components/drivers/sdio/sdio.c | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/drivers/include/drivers/sdio.h b/components/drivers/include/drivers/sdio.h index 6533ec3cbb..b52af38308 100644 --- a/components/drivers/include/drivers/sdio.h +++ b/components/drivers/include/drivers/sdio.h @@ -181,6 +181,12 @@ rt_int32_t sdio_io_rw_extended(struct rt_mmcsd_card *card, rt_uint8_t *buf, rt_uint32_t blocks, rt_uint32_t blksize); +rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, + rt_int32_t rw, + rt_uint32_t addr, + rt_int32_t op_code, + rt_uint8_t *buf, + rt_uint32_t len); rt_uint8_t sdio_io_readb(struct rt_sdio_function *func, rt_uint32_t reg, rt_int32_t *err); diff --git a/components/drivers/sdio/block_dev.c b/components/drivers/sdio/block_dev.c index 12986ae1de..ecb43a3e95 100644 --- a/components/drivers/sdio/block_dev.c +++ b/components/drivers/sdio/block_dev.c @@ -149,7 +149,7 @@ static rt_err_t rt_mmcsd_req_blk(struct rt_mmcsd_card *card, } else { - req.stop = NULL; + req.stop = RT_NULL; r_cmd = READ_SINGLE_BLOCK; w_cmd = WRITE_BLOCK; } diff --git a/components/drivers/sdio/sdio.c b/components/drivers/sdio/sdio.c index 7817ae5c50..6b2d655dd7 100644 --- a/components/drivers/sdio/sdio.c +++ b/components/drivers/sdio/sdio.c @@ -244,7 +244,7 @@ rt_inline rt_uint32_t sdio_max_block_size(struct rt_sdio_function *func) return MIN(size, 512u); /* maximum size for byte mode */ } -static rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, +rt_int32_t sdio_io_rw_extended_block(struct rt_sdio_function *func, rt_int32_t rw, rt_uint32_t addr, rt_int32_t op_code, @@ -1325,6 +1325,7 @@ rt_int32_t sdio_register_driver(struct rt_sdio_driver *driver) return -RT_ENOMEM; } + sd->drv = driver; rt_list_insert_after(&sdio_drivers, &sd->list); if (!rt_list_isempty(&sdio_cards))