/* Produce a mtd_info given a type and num. */
static int get_mtd_info(u8 type, u8 num, struct mtd_info **mtd)
/* Produce a mtd_info given a type and num. */
static int get_mtd_info(u8 type, u8 num, struct mtd_info **mtd)
{
	char mtd_dev[16];
	sprintf(mtd_dev, "%s%d", MTD_DEV_TYPE(type), num);
	*mtd = get_mtd_device_nm(mtd_dev);
	if (IS_ERR(*mtd)) {
		printf("Device %s not found!\n", mtd_dev);
		return 1;
	}
	put_mtd_device(*mtd);
	return 0;
}