[sdio] Fixed issue for requset size calculation.

This commit is contained in:
weety 2018-09-09 21:20:08 +08:00
parent 02a2b78943
commit e19cfd4571
1 changed files with 2 additions and 2 deletions

View File

@ -259,7 +259,7 @@ static rt_size_t rt_mmcsd_read(rt_device_t dev,
rt_sem_take(part->lock, RT_WAITING_FOREVER); rt_sem_take(part->lock, RT_WAITING_FOREVER);
while (remain_size) while (remain_size)
{ {
req_size = (size > blk_dev->max_req_size) ? blk_dev->max_req_size : remain_size; req_size = (remain_size > blk_dev->max_req_size) ? blk_dev->max_req_size : remain_size;
err = rt_mmcsd_req_blk(blk_dev->card, part->offset + pos + offset, rd_ptr, req_size, 0); err = rt_mmcsd_req_blk(blk_dev->card, part->offset + pos + offset, rd_ptr, req_size, 0);
if (err) if (err)
break; break;
@ -299,7 +299,7 @@ static rt_size_t rt_mmcsd_write(rt_device_t dev,
rt_sem_take(part->lock, RT_WAITING_FOREVER); rt_sem_take(part->lock, RT_WAITING_FOREVER);
while (remain_size) while (remain_size)
{ {
req_size = (size > blk_dev->max_req_size) ? blk_dev->max_req_size : remain_size; req_size = (remain_size > blk_dev->max_req_size) ? blk_dev->max_req_size : remain_size;
err = rt_mmcsd_req_blk(blk_dev->card, part->offset + pos + offset, wr_ptr, req_size, 1); err = rt_mmcsd_req_blk(blk_dev->card, part->offset + pos + offset, wr_ptr, req_size, 1);
if (err) if (err)
break; break;