[devicedrivers] fix the partition issue in mmc/sdio

This commit is contained in:
bernard 2023-01-23 23:48:01 +08:00 committed by Man, Jianting (Meco)
parent 9b109639d1
commit af143ee3f9
1 changed files with 2 additions and 2 deletions

View File

@ -303,7 +303,7 @@ static rt_size_t rt_mmcsd_read(rt_device_t dev,
while (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, 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)
break;
offset += req_size;
@ -344,7 +344,7 @@ static rt_size_t rt_mmcsd_write(rt_device_t dev,
while (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, 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)
break;
offset += req_size;