Lines Matching defs:map
15 #include <linux/mtd/map.h>
42 struct map_info map;
71 struct amd76xrom_map_info *map, *scratch;
82 list_for_each_entry_safe(map, scratch, &window->maps, list) {
83 if (map->rsrc.parent) {
84 release_resource(&map->rsrc);
86 mtd_device_unregister(map->mtd);
87 map_destroy(map->mtd);
88 list_del(&map->list);
89 kfree(map);
110 struct amd76xrom_map_info *map = NULL;
190 if (!map) {
191 map = kmalloc(sizeof(*map), GFP_KERNEL);
193 if (!map) {
197 memset(map, 0, sizeof(*map));
198 INIT_LIST_HEAD(&map->list);
199 map->map.name = map->map_name;
200 map->map.phys = map_top;
202 map->map.virt = (void __iomem *)
204 map->map.size = 0xffffffffUL - map_top + 1UL;
205 /* Set the name of the map to the address I am trying */
206 sprintf(map->map_name, "%s @%08Lx",
207 MOD_NAME, (unsigned long long)map->map.phys);
210 for(map->map.bankwidth = 32; map->map.bankwidth;
211 map->map.bankwidth >>= 1)
215 if (!map_bankwidth_supported(map->map.bankwidth))
218 /* Setup the map methods */
219 simple_map_init(&map->map);
224 map->mtd = do_map_probe(*probe_type, &map->map);
225 if (map->mtd)
232 /* Trim the size if we are larger than the map */
233 if (map->mtd->size > map->map.size) {
236 (unsigned long long)map->mtd->size, map->map.size);
237 map->mtd->size = map->map.size;
245 map->rsrc.name = map->map_name;
246 map->rsrc.start = map->map.phys;
247 map->rsrc.end = map->map.phys + map->mtd->size - 1;
248 map->rsrc.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
249 if (request_resource(&window->rsrc, &map->rsrc)) {
252 map->rsrc.parent = NULL;
256 /* Make the whole region visible in the map */
257 map->map.virt = window->virt;
258 map->map.phys = window->phys;
259 cfi = map->map.fldrv_priv;
265 map->mtd->owner = THIS_MODULE;
266 if (mtd_device_register(map->mtd, NULL, 0)) {
267 map_destroy(map->mtd);
268 map->mtd = NULL;
274 map_top += map->mtd->size;
276 /* File away the map structure */
277 list_add(&map->list, &window->maps);
278 map = NULL;
282 /* Free any left over map structures */
283 kfree(map);
284 /* See if I have any map structures */
350 MODULE_DESCRIPTION("MTD map driver for BIOS chips on the AMD76X southbridge");