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

dirvers/mtd: return early if init fails

If init fails (e.g. because an SD card was not inserted) don't
fail the `mtd->write_size != 0` assertion but instead return early.
This commit is contained in:
Benjamin Valentin 2022-06-07 00:44:04 +02:00
parent a6ac93d429
commit f7ab95ad97

View File

@ -38,6 +38,9 @@ int mtd_init(mtd_dev_t *mtd)
if (mtd->driver->init) {
res = mtd->driver->init(mtd);
if (res < 0) {
return res;
}
}
/* Drivers preceding the introduction of write_size need to set it. While