After getting MTD device via get_mtd_device_nm(), we need to put it with
put_mtd_device(), otherwise we get
Removing MTD device #0 (mx25l6405d) with use count 1
before booting kernel.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Tested-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
if (!fixup_mtd_partitions(blob, node, mtd))
goto fail;
+ put_mtd_device(mtd);
return 0;
fail:
printf("Failed fixing SPI NOR partitions!\n");
+ if (!IS_ERR_OR_NULL(mtd))
+ put_mtd_device(mtd);
return 0;
}
#endif