/* Find a contiguous vram area that contains a given offset from vram start.  */
static int vmlfb_vram_offset(struct vml_info *vinfo, unsigned long offset)
/* Find a contiguous vram area that contains a given offset from vram start.  */
static int vmlfb_vram_offset(struct vml_info *vinfo, unsigned long offset)
{
	unsigned long aoffset;
	unsigned i;
	for (i = 0; i < vinfo->num_areas; ++i) {
		aoffset = offset - (vinfo->vram[i].phys - vinfo->vram_start);
		if (aoffset < vinfo->vram[i].size) {
			return 0;
		}
	}
	return -EINVAL;
}