1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dirvers/mtd: don't use work_buf as proxy for !direct write flag

Currently work_buf is only NULL when MTD_DRIVER_FLAG_DIRECT_WRITE is
set, so it served as a proxy for that flag.

However, we might want to have a work buffer even when writes without
erase are possible.
This commit is contained in:
Benjamin Valentin 2022-03-25 12:14:20 +01:00
parent ad345eea4b
commit e3c8187736

View File

@ -201,7 +201,7 @@ int mtd_write_page(mtd_dev_t *mtd, const void *data, uint32_t page,
return -ENODEV;
}
if (mtd->work_area == NULL) {
if (mtd->driver->flags & MTD_DRIVER_FLAG_DIRECT_WRITE) {
return mtd_write_page_raw(mtd, data, page, offset, len);
}