/* * try to support NOMMU mmaps on concatenated devices * - we don't support subdev spanning as we can't guarantee it'll work */ static unsigned long concat_get_unmapped_area(struct mtd_info *mtd, unsigned long len, unsigned long offset, unsigned long flags) { struct mtd_concat *concat = CONCAT(mtd); int i; for (i = 0; i < concat->num_subdev; i++) { struct mtd_info *subdev = concat->subdev[i]; if (offset >= subdev->size) { offset -= subdev->size; continue; } /* we've found the subdev over which the mapping will reside */ if (offset + len > subdev->size) return (unsigned long) -EINVAL; return mtd_get_unmapped_area(subdev, len, offset, flags); } return (unsigned long) -ENOSYS; }
/* * try to support NOMMU mmaps on concatenated devices * - we don't support subdev spanning as we can't guarantee it'll work */ static unsigned long concat_get_unmapped_area(struct mtd_info *mtd, unsigned long len, unsigned long offset, unsigned long flags) { struct mtd_concat *concat = CONCAT(mtd); int i; for (i = 0; i < concat->num_subdev; i++) { struct mtd_info *subdev = concat->subdev[i]; if (offset >= subdev->size) { offset -= subdev->size; continue; } return mtd_get_unmapped_area(subdev, len, offset, flags); } return (unsigned long) -ENOSYS; }