/* Check device number to be within valid range for given device type. */
static int mtd_device_validate(u8 type, u8 num, u64 *size)
/* Check device number to be within valid range for given device type. */
static int mtd_device_validate(u8 type, u8 num, u64 *size)
{
	struct mtd_info *mtd = NULL;
	if (get_mtd_info(type, num, &mtd))
		return 1;
	*size = mtd->size;
	return 0;
}