Lines Matching refs:map

46 	struct map_info map;  member
84 struct ck804xrom_map_info *map, *scratch; in ck804xrom_cleanup() local
94 list_for_each_entry_safe(map, scratch, &window->maps, list) { in ck804xrom_cleanup()
95 if (map->rsrc.parent) in ck804xrom_cleanup()
96 release_resource(&map->rsrc); in ck804xrom_cleanup()
98 mtd_device_unregister(map->mtd); in ck804xrom_cleanup()
99 map_destroy(map->mtd); in ck804xrom_cleanup()
100 list_del(&map->list); in ck804xrom_cleanup()
101 kfree(map); in ck804xrom_cleanup()
123 struct ck804xrom_map_info *map = NULL; in ck804xrom_init_one() local
220 if (!map) { in ck804xrom_init_one()
221 map = kmalloc(sizeof(*map), GFP_KERNEL); in ck804xrom_init_one()
222 if (!map) in ck804xrom_init_one()
225 memset(map, 0, sizeof(*map)); in ck804xrom_init_one()
226 INIT_LIST_HEAD(&map->list); in ck804xrom_init_one()
227 map->map.name = map->map_name; in ck804xrom_init_one()
228 map->map.phys = map_top; in ck804xrom_init_one()
230 map->map.virt = (void __iomem *) in ck804xrom_init_one()
232 map->map.size = 0xffffffffUL - map_top + 1UL; in ck804xrom_init_one()
234 sprintf(map->map_name, "%s @%08Lx", in ck804xrom_init_one()
235 MOD_NAME, (unsigned long long)map->map.phys); in ck804xrom_init_one()
238 for(map->map.bankwidth = 32; map->map.bankwidth; in ck804xrom_init_one()
239 map->map.bankwidth >>= 1) in ck804xrom_init_one()
243 if (!map_bankwidth_supported(map->map.bankwidth)) in ck804xrom_init_one()
247 simple_map_init(&map->map); in ck804xrom_init_one()
252 map->mtd = do_map_probe(*probe_type, &map->map); in ck804xrom_init_one()
253 if (map->mtd) in ck804xrom_init_one()
261 if (map->mtd->size > map->map.size) { in ck804xrom_init_one()
264 (unsigned long long)map->mtd->size, map->map.size); in ck804xrom_init_one()
265 map->mtd->size = map->map.size; in ck804xrom_init_one()
273 map->rsrc.name = map->map_name; in ck804xrom_init_one()
274 map->rsrc.start = map->map.phys; in ck804xrom_init_one()
275 map->rsrc.end = map->map.phys + map->mtd->size - 1; in ck804xrom_init_one()
276 map->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY; in ck804xrom_init_one()
277 if (request_resource(&window->rsrc, &map->rsrc)) { in ck804xrom_init_one()
280 map->rsrc.parent = NULL; in ck804xrom_init_one()
285 map->map.virt = window->virt; in ck804xrom_init_one()
286 map->map.phys = window->phys; in ck804xrom_init_one()
287 cfi = map->map.fldrv_priv; in ck804xrom_init_one()
292 map->mtd->owner = THIS_MODULE; in ck804xrom_init_one()
293 if (mtd_device_register(map->mtd, NULL, 0)) { in ck804xrom_init_one()
294 map_destroy(map->mtd); in ck804xrom_init_one()
295 map->mtd = NULL; in ck804xrom_init_one()
301 map_top += map->mtd->size; in ck804xrom_init_one()
304 list_add(&map->list, &window->maps); in ck804xrom_init_one()
305 map = NULL; in ck804xrom_init_one()
310 kfree(map); in ck804xrom_init_one()