static void __exit cleanup_flagadm(void) { if (mymtd) { del_mtd_partitions(mymtd); map_destroy(mymtd); } if (flagadm_map.virt) { iounmap((void *)flagadm_map.virt); flagadm_map.virt = 0; } }
static void __exit cleanup_netsc520(void) { if (mymtd) { del_mtd_partitions(mymtd); map_destroy(mymtd); } if (netsc520_map.virt) { iounmap(netsc520_map.virt); netsc520_map.virt = NULL; } }
static void __exit cleanup_dbox2_flash(void) { if (mymtd) { del_mtd_partitions(mymtd); map_destroy(mymtd); } if (dbox2_flash_map.virt) { iounmap((void *)dbox2_flash_map.virt); dbox2_flash_map.virt = 0; } }
static void __exit cleanup_mpc8313rdb(void) { if (mymtd) { del_mtd_device(mymtd); map_destroy(mymtd); } if (mpc8313rdb_map.virt) { iounmap((void *)mpc8313rdb_map.virt); mpc8313rdb_map.virt = 0; } }
static void __exit cleanup_flagadm(void) { if (mymtd) { mtd_device_unregister(mymtd); map_destroy(mymtd); } if (flagadm_map.virt) { iounmap((void *)flagadm_map.virt); flagadm_map.virt = 0; } }
static void __exit cleanup_rpxlite(void) { if (mymtd) { mtd_device_unregister(mymtd); map_destroy(mymtd); } if (rpxlite_map.virt) { iounmap((void *)rpxlite_map.virt); rpxlite_map.virt = 0; } }
static void __exit cleanup_iq80310(void) { if (mymtd) { del_mtd_partitions(mymtd); map_destroy(mymtd); if (parsed_parts) kfree(parsed_parts); } if (iq80310_map.virt) iounmap((void *)iq80310_map.virt); }
static void __exit cleanup_rpxlite(void) { if (mymtd) { del_mtd_device(mymtd); map_destroy(mymtd); } if (rpxlite_map.map_priv_1) { iounmap((void *)rpxlite_map.map_priv_1); rpxlite_map.map_priv_1 = 0; } }
static void __exit cleanup_mbx(void) { if (mymtd) { del_mtd_device(mymtd); map_destroy(mymtd); } if (mbx_map.virt) { iounmap((void *)mbx_map.virt); mbx_map.virt = 0; } }
static void __exit bcm476x_mtd_ram_map_exit(void) { #ifdef CONFIG_MTD_PARTITIONS del_mtd_partitions(bcm476x_mtd_ram); #else /* CONFIG_MTD_PARTITIONS */ del_mtd_device(bcm476x_mtd_ram); #endif map_destroy(bcm476x_mtd_ram); iounmap((void *)bcm476x_mtd_ram_map.virt); bcm476x_mtd_ram_map.virt = 0; }
static int __devexit bfin_flash_remove(struct platform_device *pdev) { struct async_state *state = platform_get_drvdata(pdev); gpio_free(state->enet_flash_pin); #ifdef CONFIG_MTD_PARTITIONS del_mtd_partitions(state->mtd); kfree(state->parts); #endif map_destroy(state->mtd); kfree(state); return 0; }
static void __exit nettel_mtd_cleanup(void) { if (flash_mtdinfo) { del_mtd_partitions(flash_mtdinfo); map_destroy(flash_mtdinfo); flash_mtdinfo = NULL; } if (ram_mtdinfo) { del_mtd_partitions(ram_mtdinfo); map_destroy(ram_mtdinfo); ram_mtdinfo = NULL; } if (nettel_ram_map.map_priv_1) { iounmap((void *)nettel_ram_map.map_priv_1); nettel_ram_map.map_priv_1 = 0; } if (nettel_flash_map.map_priv_1) { iounmap((void *)nettel_flash_map.map_priv_1); nettel_flash_map.map_priv_1 = 0; } }
void __exit uclinux_mtd_cleanup(void) { if (uclinux_ram_mtdinfo) { del_mtd_partitions(uclinux_ram_mtdinfo); map_destroy(uclinux_ram_mtdinfo); uclinux_ram_mtdinfo = NULL; } if (uclinux_ram_map.map_priv_1) { iounmap((void *) uclinux_ram_map.map_priv_1); uclinux_ram_map.map_priv_1 = 0; } }
static void __exit nettel_mtd_cleanup(void) { if (flash_mtdinfo) { mtd_device_unregister(flash_mtdinfo); map_destroy(flash_mtdinfo); flash_mtdinfo = NULL; } if (ram_mtdinfo) { mtd_device_unregister(ram_mtdinfo); map_destroy(ram_mtdinfo); ram_mtdinfo = NULL; } if (nettel_ram_map.map_priv_1) { iounmap((void *)nettel_ram_map.map_priv_1); nettel_ram_map.map_priv_1 = 0; } if (nettel_flash_map.map_priv_1) { iounmap((void *)nettel_flash_map.map_priv_1); nettel_flash_map.map_priv_1 = 0; } }
static void __exit cleanup_ts5500_map(void) { if (mymtd) { del_mtd_partitions(mymtd); map_destroy(mymtd); } if (ts5500_map.virt) { iounmap(ts5500_map.virt); ts5500_map.virt = NULL; } }
static void __exit cleanup_vmax301(void) { int i; for (i=0; i<2; i++) { if (vmax_mtd[i]) { del_mtd_device(vmax_mtd[i]); map_destroy(vmax_mtd[i]); } } iounmap((void *)vmax_map[0].map_priv_1 - WINDOW_START); }
static int __devexit gpio_flash_remove(struct platform_device *pdev) { struct async_state *state = platform_get_drvdata(pdev); size_t i = 0; do { gpio_free(state->gpio_addrs[i]); } while (++i < state->gpio_count); mtd_device_unregister(state->mtd); map_destroy(state->mtd); kfree(state); return 0; }
static void __exit cleanup_walnut(void) { if (flash) { del_mtd_partitions(flash); map_destroy(flash); } if (walnut_map.virt) { iounmap((void *)walnut_map.virt); walnut_map.virt = 0; } }
static void __exit cleanup_ts5500_map(void) { if (mymtd) { mtd_device_unregister(mymtd); map_destroy(mymtd); } if (ts5500_map.virt) { iounmap(ts5500_map.virt); ts5500_map.virt = NULL; } }
static void __exit cleanup_csbxxx(void) { if (!mymtd) return; del_mtd_partitions(mymtd); map_destroy(mymtd); iounmap((void *)csbxxx_map.virt); if (csbxxx_map.cached) iounmap(csbxxx_map.cached); }
void pcmcia_sleeve_detach_flash(void) { printk(" ### " __FUNCTION__ "\n"); if (pcmcia_sleeve_mtd != NULL) { printk(" ### " __FUNCTION__ " 2\n"); del_mtd_device(pcmcia_sleeve_mtd); printk(" #### " __FUNCTION__ " 3\n"); map_destroy(pcmcia_sleeve_mtd); printk(" ### " __FUNCTION__ " 4\n"); pcmcia_sleeve_mtd = NULL; } }
static void __exit uclinux_mtd_cleanup(void) { if (uclinux_ram_mtdinfo) { mtd_device_unregister(uclinux_ram_mtdinfo); map_destroy(uclinux_ram_mtdinfo); uclinux_ram_mtdinfo = NULL; } if (uclinux_ram_map.virt) { iounmap((void *) uclinux_ram_map.virt); uclinux_ram_map.virt = 0; } }
static void __exit cleanup_impa7(void) { int i; for (i=0; i<NUM_FLASHBANKS; i++) { if (impa7_mtd[i]) { mtd_device_unregister(impa7_mtd[i]); map_destroy(impa7_mtd[i]); iounmap((void *)impa7_map[i].virt); impa7_map[i].virt = 0; } } }
static void __exit cleanup_dc21285(void) { #ifdef CONFIG_MTD_PARTITIONS if (dc21285_parts) { del_mtd_partitions(dc21285_mtd); kfree(dc21285_parts); } else #endif del_mtd_device(dc21285_mtd); map_destroy(dc21285_mtd); iounmap((void *)dc21285_map.map_priv_1); }
static void __exit h720x_mtd_cleanup(void) { if (mymtd) { mtd_device_unregister(mymtd); map_destroy(mymtd); } if (h720x_map.virt) { iounmap((void *)h720x_map.virt); h720x_map.virt = 0; } }
void join_all_threads() { if(m_threads) { iterator_map *p_it = m_threads->begin; while(p_it) { pthread_t *p_thread = p_it->value; pthread_join(*p_thread,NULL); map_erase(m_threads, p_it->key); p_it = m_threads->begin; } } map_destroy(&m_threads); return; }
static void mtd_pci_remove(struct pci_dev *dev) { struct mtd_info *mtd = pci_get_drvdata(dev); struct map_pci_info *map = mtd->priv; mtd_device_unregister(mtd); map_destroy(mtd); map->exit(dev, map); kfree(map); pci_set_drvdata(dev, NULL); pci_release_regions(dev); }
static void __exit cleanup_taihu_flash(void) { if (taihu_mtd) { del_mtd_partitions(taihu_mtd); /* moved iounmap after map_destroy - armin */ map_destroy(taihu_mtd); } if (taihu_bootflash_map.virt) iounmap((void *)taihu_bootflash_map.virt); if (taihu_appflash_map.virt) iounmap((void *)taihu_appflash_map.virt); }
/***************************** main function *****************************/ int main(int argc, char **argv) { struct map *map; int x0, y0, x1, y1; /* parse args */ if (argc < 6) { fprintf(stderr, "%s needs at least 5 arguments (%d were given)\n", PROGRAM_NAME, argc-1); fprintf(stderr, "usage: %s mapfile x0 y0 x1 y1 (time_interval - optional)\n", PROGRAM_NAME); exit(EXIT_FAILURE); } x0 = atoi(argv[2]); y0 = atoi(argv[3]); x1 = atoi(argv[4]); y1 = atoi(argv[5]); g_curses_interval = 0; if (argc > 6) { g_curses_interval = atoi(argv[6]); } map = load_map(argv[1]); if (!map) { fprintf(stderr, "Error loading map.\n"); exit(EXIT_FAILURE); } if ((x0 <= 0 || x0 >= map->width-1) || (x1 <= 0 || x1 >= map->width-1) || (y0 <= 0 || y0 >= map->height-1) || (y1 <= 0 || y1 >= map->height-1)) { fprintf(stderr, "Coordinates are not in range.\n"); exit(EXIT_FAILURE); } /* initialise the curses animation if we're using that */ if (g_curses_interval > 0) { init_curses(); } make_path(map, x0, y0, x1, y1); if (g_curses_interval > 0) { end_curses(); } else { print_path(map, x0, y0, x1, y1); } map_destroy(map); return EXIT_SUCCESS; }
/** * Destroy the DBM wrapper, optionally closing the underlying DB map. */ void dbmw_destroy(dbmw_t *dw, bool close_map) { dbmw_check(dw); if (common_stats) { s_debug("DBMW destroying \"%s\" with %s back-end " "(read cache hits = %.2f%% on %s request%s, " "write cache hits = %.2f%% on %s request%s)", dw->name, dbmw_map_type(dw) == DBMAP_SDBM ? "sdbm" : "map", dw->r_hits * 100.0 / MAX(1, dw->r_access), uint64_to_string(dw->r_access), plural(dw->r_access), dw->w_hits * 100.0 / MAX(1, dw->w_access), uint64_to_string2(dw->w_access), plural(dw->w_access)); } if (dbg_ds_debugging(dw->dbg, 1, DBG_DSF_DESTROY)) { dbg_ds_log(dw->dbg, dw, "%s: with %s back-end " "(read cache hits = %.2f%% on %s request%s, " "write cache hits = %.2f%% on %s request%s)", G_STRFUNC, dbmw_map_type(dw) == DBMAP_SDBM ? "sdbm" : "map", dw->r_hits * 100.0 / MAX(1, dw->r_access), uint64_to_string(dw->r_access), plural(dw->r_access), dw->w_hits * 100.0 / MAX(1, dw->w_access), uint64_to_string2(dw->w_access), plural(dw->w_access)); } /* * If we close the map and we're volatile, there's no need to flush * the cache as the data is going to be gone soon anyway. */ if (!close_map || !dw->is_volatile) { dbmw_sync(dw, DBMW_SYNC_CACHE); } dbmw_clear_cache(dw); hash_list_free(&dw->keys); map_destroy(dw->values); if (dw->mb) pmsg_free(dw->mb); bstr_free(&dw->bs); if (close_map) dbmap_destroy(dw->dm); WFREE_TYPE_NULL(dw->dbmap_dbg); dw->magic = 0; WFREE(dw); }