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

Merge pull request #17913 from benpicco/mtd_fixes

mtd: minor cleanup & test fixes
This commit is contained in:
benpicco 2022-04-12 09:30:27 +02:00 committed by GitHub
commit e3f9252947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

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);
}

View File

@ -107,14 +107,14 @@ static int cmd_read(int argc, char **argv)
int res = mtd_read(dev, buffer, addr, len);
od_hex_dump_ext(buffer, len, 0, addr);
free(buffer);
if (res) {
printf("error: %i\n", res);
} else {
od_hex_dump_ext(buffer, len, 0, addr);
}
free(buffer);
return res;
}
@ -140,14 +140,14 @@ static int cmd_read_page(int argc, char **argv)
int res = mtd_read_page(dev, buffer, page, offset, len);
od_hex_dump_ext(buffer, len, 0, page * dev->page_size + offset);
free(buffer);
if (res) {
printf("error: %i\n", res);
} else {
od_hex_dump_ext(buffer, len, 0, page * dev->page_size + offset);
}
free(buffer);
return res;
}