From 4694c6c4c47ffb4371bab65345720dafe7ea73d2 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 24 Mar 2022 22:55:54 +0100 Subject: [PATCH] drivers/mtd_mci: fix sector erase --- drivers/mtd_mci/mtd_mci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/mtd_mci/mtd_mci.c b/drivers/mtd_mci/mtd_mci.c index 7c83260417..77da2a2230 100644 --- a/drivers/mtd_mci/mtd_mci.c +++ b/drivers/mtd_mci/mtd_mci.c @@ -118,10 +118,11 @@ static int mtd_mci_erase_sector(mtd_dev_t *dev, uint32_t sector, uint32_t count) { (void)dev; - while (count--) { - mci_ioctl(CTRL_ERASE_SECTOR, §or); - ++sector; - } + uint32_t arg[2] = { + sector, sector + count - 1 + }; + + mci_ioctl(CTRL_ERASE_SECTOR, arg); return 0; }