/* @frba: Flash region list @region_type: Type of region (0..MAX_REGIONS-1) @region: Region information is written here  */
static int get_region(struct frba_t *frba, int region_type, struct region_t *region)
/* @frba: Flash region list @region_type: Type of region (0..MAX_REGIONS-1) @region: Region information is written here  */
static int get_region(struct frba_t *frba, int region_type, struct region_t *region)
{
	if (region_type >= MAX_REGIONS) {
		fprintf(stderr, "Invalid region type.\n");
		return -1;
	}
	region->base = FLREG_BASE(frba->flreg[region_type]);
	region->limit = FLREG_LIMIT(frba->flreg[region_type]);
	region->size = region->limit - region->base + 1;
	return 0;
}