Lines Matching refs:map
47 struct map_info map; member
59 struct ichxrom_map_info *map, *scratch; in ichxrom_cleanup() local
70 list_for_each_entry_safe(map, scratch, &window->maps, list) { in ichxrom_cleanup()
71 if (map->rsrc.parent) in ichxrom_cleanup()
72 release_resource(&map->rsrc); in ichxrom_cleanup()
73 mtd_device_unregister(map->mtd); in ichxrom_cleanup()
74 map_destroy(map->mtd); in ichxrom_cleanup()
75 list_del(&map->list); in ichxrom_cleanup()
76 kfree(map); in ichxrom_cleanup()
95 struct ichxrom_map_info *map = NULL; in ichxrom_init_one() local
214 if (!map) { in ichxrom_init_one()
215 map = kmalloc(sizeof(*map), GFP_KERNEL); in ichxrom_init_one()
216 if (!map) in ichxrom_init_one()
219 memset(map, 0, sizeof(*map)); in ichxrom_init_one()
220 INIT_LIST_HEAD(&map->list); in ichxrom_init_one()
221 map->map.name = map->map_name; in ichxrom_init_one()
222 map->map.phys = map_top; in ichxrom_init_one()
224 map->map.virt = (void __iomem *) in ichxrom_init_one()
226 map->map.size = 0xffffffffUL - map_top + 1UL; in ichxrom_init_one()
228 sprintf(map->map_name, "%s @%08Lx", in ichxrom_init_one()
229 MOD_NAME, (unsigned long long)map->map.phys); in ichxrom_init_one()
235 for(map->map.bankwidth = 32; map->map.bankwidth; in ichxrom_init_one()
236 map->map.bankwidth >>= 1) in ichxrom_init_one()
240 if (!map_bankwidth_supported(map->map.bankwidth)) in ichxrom_init_one()
244 simple_map_init(&map->map); in ichxrom_init_one()
249 map->mtd = do_map_probe(*probe_type, &map->map); in ichxrom_init_one()
250 if (map->mtd) in ichxrom_init_one()
258 if (map->mtd->size > map->map.size) { in ichxrom_init_one()
261 (unsigned long long)map->mtd->size, map->map.size); in ichxrom_init_one()
262 map->mtd->size = map->map.size; in ichxrom_init_one()
270 map->rsrc.name = map->map_name; in ichxrom_init_one()
271 map->rsrc.start = map->map.phys; in ichxrom_init_one()
272 map->rsrc.end = map->map.phys + map->mtd->size - 1; in ichxrom_init_one()
273 map->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY; in ichxrom_init_one()
274 if (request_resource(&window->rsrc, &map->rsrc)) { in ichxrom_init_one()
277 map->rsrc.parent = NULL; in ichxrom_init_one()
282 map->map.virt = window->virt; in ichxrom_init_one()
283 map->map.phys = window->phys; in ichxrom_init_one()
284 cfi = map->map.fldrv_priv; in ichxrom_init_one()
290 map->mtd->owner = THIS_MODULE; in ichxrom_init_one()
291 if (mtd_device_register(map->mtd, NULL, 0)) { in ichxrom_init_one()
292 map_destroy(map->mtd); in ichxrom_init_one()
293 map->mtd = NULL; in ichxrom_init_one()
299 map_top += map->mtd->size; in ichxrom_init_one()
302 list_add(&map->list, &window->maps); in ichxrom_init_one()
303 map = NULL; in ichxrom_init_one()
308 kfree(map); in ichxrom_init_one()