Lines Matching refs:map

41 	struct map_info map;  member
70 struct amd76xrom_map_info *map, *scratch; in amd76xrom_cleanup() local
81 list_for_each_entry_safe(map, scratch, &window->maps, list) { in amd76xrom_cleanup()
82 if (map->rsrc.parent) { in amd76xrom_cleanup()
83 release_resource(&map->rsrc); in amd76xrom_cleanup()
85 mtd_device_unregister(map->mtd); in amd76xrom_cleanup()
86 map_destroy(map->mtd); in amd76xrom_cleanup()
87 list_del(&map->list); in amd76xrom_cleanup()
88 kfree(map); in amd76xrom_cleanup()
109 struct amd76xrom_map_info *map = NULL; in amd76xrom_init_one() local
189 if (!map) { in amd76xrom_init_one()
190 map = kmalloc(sizeof(*map), GFP_KERNEL); in amd76xrom_init_one()
192 if (!map) { in amd76xrom_init_one()
196 memset(map, 0, sizeof(*map)); in amd76xrom_init_one()
197 INIT_LIST_HEAD(&map->list); in amd76xrom_init_one()
198 map->map.name = map->map_name; in amd76xrom_init_one()
199 map->map.phys = map_top; in amd76xrom_init_one()
201 map->map.virt = (void __iomem *) in amd76xrom_init_one()
203 map->map.size = 0xffffffffUL - map_top + 1UL; in amd76xrom_init_one()
205 sprintf(map->map_name, "%s @%08Lx", in amd76xrom_init_one()
206 MOD_NAME, (unsigned long long)map->map.phys); in amd76xrom_init_one()
209 for(map->map.bankwidth = 32; map->map.bankwidth; in amd76xrom_init_one()
210 map->map.bankwidth >>= 1) in amd76xrom_init_one()
214 if (!map_bankwidth_supported(map->map.bankwidth)) in amd76xrom_init_one()
218 simple_map_init(&map->map); in amd76xrom_init_one()
223 map->mtd = do_map_probe(*probe_type, &map->map); in amd76xrom_init_one()
224 if (map->mtd) in amd76xrom_init_one()
232 if (map->mtd->size > map->map.size) { in amd76xrom_init_one()
235 (unsigned long long)map->mtd->size, map->map.size); in amd76xrom_init_one()
236 map->mtd->size = map->map.size; in amd76xrom_init_one()
244 map->rsrc.name = map->map_name; in amd76xrom_init_one()
245 map->rsrc.start = map->map.phys; in amd76xrom_init_one()
246 map->rsrc.end = map->map.phys + map->mtd->size - 1; in amd76xrom_init_one()
247 map->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY; in amd76xrom_init_one()
248 if (request_resource(&window->rsrc, &map->rsrc)) { in amd76xrom_init_one()
251 map->rsrc.parent = NULL; in amd76xrom_init_one()
256 map->map.virt = window->virt; in amd76xrom_init_one()
257 map->map.phys = window->phys; in amd76xrom_init_one()
258 cfi = map->map.fldrv_priv; in amd76xrom_init_one()
264 map->mtd->owner = THIS_MODULE; in amd76xrom_init_one()
265 if (mtd_device_register(map->mtd, NULL, 0)) { in amd76xrom_init_one()
266 map_destroy(map->mtd); in amd76xrom_init_one()
267 map->mtd = NULL; in amd76xrom_init_one()
273 map_top += map->mtd->size; in amd76xrom_init_one()
276 list_add(&map->list, &window->maps); in amd76xrom_init_one()
277 map = NULL; in amd76xrom_init_one()
282 kfree(map); in amd76xrom_init_one()