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:
parent
a6ac93d429
commit
f7ab95ad97
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user