driver/mtd/ftl: Modify erasure result processing error issue

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
chenrun1 2023-05-17 15:38:20 +08:00 committed by Xiang Xiao
parent 0a52dfaa66
commit c267791f06

View File

@ -383,7 +383,7 @@ static ssize_t ftl_mtd_erase(FAR struct ftl_struct_s *dev, off_t startblock)
if (dev->lptable == NULL)
{
ret = MTD_ERASE(dev->mtd, startblock, 1);
if (ret != 1)
if (ret < 0)
{
ferr("ERROR: Erase block %" PRIdOFF " failed: %zd\n",
startblock, ret);