mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
drivers/mmcsd: Pass the right buffer size to SDIO_DMAPREFLIGHT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Gustavo Henrique Nihei
parent
acf18bd82d
commit
60b2a0e2a0
@@ -1502,7 +1502,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
FAR uint8_t *buffer, off_t startblock,
|
FAR uint8_t *buffer, off_t startblock,
|
||||||
size_t nblocks)
|
size_t nblocks)
|
||||||
{
|
{
|
||||||
size_t nbytes;
|
size_t nbytes = nblocks << priv->blockshift;
|
||||||
off_t offset;
|
off_t offset;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -1524,7 +1524,7 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
|
|
||||||
if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
|
if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
|
||||||
{
|
{
|
||||||
ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, priv->blocksize);
|
ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, nbytes);
|
||||||
|
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
@@ -1552,7 +1552,6 @@ static ssize_t mmcsd_readmultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
* offset
|
* offset
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nbytes = nblocks << priv->blockshift;
|
|
||||||
if (IS_BLOCK(priv->type))
|
if (IS_BLOCK(priv->type))
|
||||||
{
|
{
|
||||||
offset = startblock;
|
offset = startblock;
|
||||||
@@ -1878,8 +1877,8 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
FAR const uint8_t *buffer,
|
FAR const uint8_t *buffer,
|
||||||
off_t startblock, size_t nblocks)
|
off_t startblock, size_t nblocks)
|
||||||
{
|
{
|
||||||
|
size_t nbytes = nblocks << priv->blockshift;
|
||||||
off_t offset;
|
off_t offset;
|
||||||
size_t nbytes;
|
|
||||||
int ret;
|
int ret;
|
||||||
int evret = OK;
|
int evret = OK;
|
||||||
|
|
||||||
@@ -1903,7 +1902,7 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
|
|
||||||
if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
|
if ((priv->caps & SDIO_CAPS_DMASUPPORTED) != 0)
|
||||||
{
|
{
|
||||||
ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, priv->blocksize);
|
ret = SDIO_DMAPREFLIGHT(priv->dev, buffer, nbytes);
|
||||||
|
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
@@ -1931,7 +1930,6 @@ static ssize_t mmcsd_writemultiple(FAR struct mmcsd_state_s *priv,
|
|||||||
* offset
|
* offset
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nbytes = nblocks << priv->blockshift;
|
|
||||||
if (IS_BLOCK(priv->type))
|
if (IS_BLOCK(priv->type))
|
||||||
{
|
{
|
||||||
offset = startblock;
|
offset = startblock;
|
||||||
|
|||||||
Reference in New Issue
Block a user