Lines Matching defs:map
15 #include <linux/mtd/map.h>
47 struct map_info map;
59 struct ichxrom_map_info *map, *scratch;
70 list_for_each_entry_safe(map, scratch, &window->maps, list) {
71 if (map->rsrc.parent)
72 release_resource(&map->rsrc);
73 mtd_device_unregister(map->mtd);
74 map_destroy(map->mtd);
75 list_del(&map->list);
76 kfree(map);
95 struct ichxrom_map_info *map = NULL;
214 if (!map) {
215 map = kmalloc(sizeof(*map), GFP_KERNEL);
217 if (!map) {
221 memset(map, 0, sizeof(*map));
222 INIT_LIST_HEAD(&map->list);
223 map->map.name = map->map_name;
224 map->map.phys = map_top;
226 map->map.virt = (void __iomem *)
228 map->map.size = 0xffffffffUL - map_top + 1UL;
229 /* Set the name of the map to the address I am trying */
230 sprintf(map->map_name, "%s @%08Lx",
231 MOD_NAME, (unsigned long long)map->map.phys);
237 for(map->map.bankwidth = 32; map->map.bankwidth;
238 map->map.bankwidth >>= 1)
242 if (!map_bankwidth_supported(map->map.bankwidth))
245 /* Setup the map methods */
246 simple_map_init(&map->map);
251 map->mtd = do_map_probe(*probe_type, &map->map);
252 if (map->mtd)
259 /* Trim the size if we are larger than the map */
260 if (map->mtd->size > map->map.size) {
263 (unsigned long long)map->mtd->size, map->map.size);
264 map->mtd->size = map->map.size;
272 map->rsrc.name = map->map_name;
273 map->rsrc.start = map->map.phys;
274 map->rsrc.end = map->map.phys + map->mtd->size - 1;
275 map->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
276 if (request_resource(&window->rsrc, &map->rsrc)) {
279 map->rsrc.parent = NULL;
283 /* Make the whole region visible in the map */
284 map->map.virt = window->virt;
285 map->map.phys = window->phys;
286 cfi = map->map.fldrv_priv;
292 map->mtd->owner = THIS_MODULE;
293 if (mtd_device_register(map->mtd, NULL, 0)) {
294 map_destroy(map->mtd);
295 map->mtd = NULL;
301 map_top += map->mtd->size;
303 /* File away the map structure */
304 list_add(&map->list, &window->maps);
305 map = NULL;
309 /* Free any left over map structures */
310 kfree(map);
312 /* See if I have any map structures */
383 MODULE_DESCRIPTION("MTD map driver for BIOS chips on the ICHX southbridge");