mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
mtd/config: fix byte read interface test
This commit is contained in:
committed by
Gregory Nutt
parent
797e3c3ca4
commit
58a0b09b82
@@ -148,7 +148,7 @@ static const struct file_operations mtdconfig_fops =
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: mtdconfig_readbytes
|
* Name: mtdconfig_readbytes
|
||||||
*
|
*
|
||||||
* Reads bytes from the contained MTD device. This will either usee
|
* Reads bytes from the contained MTD device. This will either use
|
||||||
* the read function or if that is not available, the bread with a copy.
|
* the read function or if that is not available, the bread with a copy.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -162,9 +162,9 @@ static int mtdconfig_readbytes(FAR struct mtdconfig_struct_s *dev, int offset,
|
|||||||
int ret = OK;
|
int ret = OK;
|
||||||
size_t bytes;
|
size_t bytes;
|
||||||
|
|
||||||
/* Test if read interface supported. If it is, use it directly */
|
/* Test if read interface supported. If it is, use it directly. */
|
||||||
|
|
||||||
if ((dev->mtd->read == NULL) && (readlen < dev->blocksize))
|
if ((dev->mtd->read != NULL) && (readlen < dev->blocksize))
|
||||||
{
|
{
|
||||||
/* Read interface available. Read directly to buffer */
|
/* Read interface available. Read directly to buffer */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user