/* Scan the flash and attempt to attach via fastmap  */
static void ipl_scan(struct ubi_scan_info *ubi)
/* Scan the flash and attempt to attach via fastmap  */
static void ipl_scan(struct ubi_scan_info *ubi)
{
	unsigned int pnum;
	int res;
	for (pnum = 0; pnum < UBI_FM_MAX_START; pnum++) {
		res = ubi_scan_vid_hdr(ubi, ubi->blockinfo + pnum, pnum);
		if (res != UBI_FASTMAP_ANCHOR)
			continue;
		if (!ubi->fm_enabled)
			continue;
		if (!ubi_scan_fastmap(ubi, NULL, pnum))
			return;
		memset(ubi->volinfo, 0, sizeof(ubi->volinfo));
		pnum = 0;
		break;
	}
	for (; pnum < ubi->peb_count; pnum++)
		ubi_scan_vid_hdr(ubi, ubi->blockinfo + pnum, pnum);
}