With this patch we set the type back to NONE upon failing UBI partition
initialization. Otherwise further calls to the UBI subsystem would try
to really access the non-existing UBI partition.
Thanks to Michael Lawnick for pointing this out.
Signed-off-by: Stefan Roese <sr@denx.de>
err = ubi_dev_scan(ubi_dev.mtd_info, ubi_dev.part_name);
if (err) {
printf("UBI init error %d\n", err);
+ ubi_dev.type = DEV_TYPE_NONE;
return err;
}