示例#1
0
static void __exit lart_flash_exit (void)
{
#ifndef HAVE_PARTITIONS
   mtd_device_unregister(&mtd);
#else
   mtd_device_unregister(&mtd);
#endif
}
static void __exit cleanup_soleng_maps(void)
{
	if (eprom_mtd) {
		mtd_device_unregister(eprom_mtd);
		map_destroy(eprom_mtd);
	}

	mtd_device_unregister(flash_mtd);
	map_destroy(flash_mtd);
}
示例#3
0
static int __devexit comcertoflash_remove(struct platform_device *pdev)
{
	struct comcertoflash_info *info = platform_get_drvdata(pdev);
        struct flash_platform_data *plat = pdev->dev.platform_data;

	platform_set_drvdata(pdev, NULL);

        if(!info)
                return 0;

        if (info->mtd) {
                mtd_device_unregister(info->mtd);
                map_destroy(info->mtd);
        }
        if (info->map.virt)
                iounmap(info->map.virt);

        if (info->res) {
                release_resource(info->res);
                kfree(info->res);
        }

        if (plat->exit)
                plat->exit();

	return 0;
}
示例#4
0
static int ixp4xx_flash_remove(struct platform_device *dev)
{
    struct flash_platform_data *plat = dev->dev.platform_data;
    struct ixp4xx_flash_info *info = platform_get_drvdata(dev);

    platform_set_drvdata(dev, NULL);

    if(!info)
        return 0;

    if (info->mtd) {
        mtd_device_unregister(info->mtd);
        map_destroy(info->mtd);
    }
    if (info->map.virt)
        iounmap(info->map.virt);

    kfree(info->partitions);

    if (info->res) {
        release_resource(info->res);
        kfree(info->res);
    }

    if (plat->exit)
        plat->exit();

    return 0;
}
示例#5
0
/**
 * op_release - Release the driver
 * @pdev: the platform device
 *
 * Returns 0
 */
static int powernv_flash_release(struct platform_device *pdev)
{
	struct powernv_flash *data = dev_get_drvdata(&(pdev->dev));

	/* All resources should be freed automatically */
	return mtd_device_unregister(&(data->mtd));
}
static int latch_addr_flash_remove(struct platform_device *dev)
{
	struct latch_addr_flash_info *info;
	struct latch_addr_flash_data *latch_addr_data;

	info = platform_get_drvdata(dev);
	if (info == NULL)
		return 0;
	platform_set_drvdata(dev, NULL);

	latch_addr_data = dev->dev.platform_data;

	if (info->mtd != NULL) {
		mtd_device_unregister(info->mtd);
		map_destroy(info->mtd);
	}

	if (info->map.virt != NULL)
		iounmap(info->map.virt);

	if (info->res != NULL)
		release_mem_region(info->res->start, resource_size(info->res));

	kfree(info);

	if (latch_addr_data->done)
		latch_addr_data->done(latch_addr_data->data);

	return 0;
}
示例#7
0
文件: l440gx.c 项目: 020gzh/linux
static void __exit cleanup_l440gx(void)
{
	mtd_device_unregister(mymtd);
	map_destroy(mymtd);

	iounmap(l440gx_map.virt);
}
示例#8
0
文件: plat-ram.c 项目: 3null/linux
static int platram_remove(struct platform_device *pdev)
{
	struct platram_info *info = to_platram_info(pdev);

	dev_dbg(&pdev->dev, "removing device\n");

	if (info == NULL)
		return 0;

	if (info->mtd) {
		mtd_device_unregister(info->mtd);
		map_destroy(info->mtd);
	}

	/* ensure ram is left read-only */

	platram_setrw(info, PLATRAM_RO);

	/* release resources */

	if (info->area) {
		release_resource(info->area);
		kfree(info->area);
	}

	if (info->map.virt != NULL)
		iounmap(info->map.virt);

	kfree(info);

	return 0;
}
示例#9
0
static int of_flash_remove(struct platform_device *dev)
{
	struct of_flash *info;
	int i;

	info = dev_get_drvdata(&dev->dev);
	if (!info)
		return 0;
	dev_set_drvdata(&dev->dev, NULL);

	if (info->cmtd) {
		mtd_device_unregister(info->cmtd);
		if (info->cmtd != info->list[0].mtd)
			mtd_concat_destroy(info->cmtd);
	}

	for (i = 0; i < info->list_size; i++) {
		if (info->list[i].mtd)
			map_destroy(info->list[i].mtd);

		if (info->list[i].map.virt)
			iounmap(info->list[i].map.virt);

		if (info->list[i].res) {
			release_resource(info->list[i].res);
			kfree(info->list[i].res);
		}
	}
	return 0;
}
示例#10
0
static int physmap_flash_remove(struct platform_device *dev)
{
	struct physmap_flash_info *info;
	struct physmap_flash_data *physmap_data;
	int i;

	info = platform_get_drvdata(dev);
	if (info == NULL)
		return 0;
	platform_set_drvdata(dev, NULL);

	physmap_data = dev->dev.platform_data;

	if (info->cmtd) {
		mtd_device_unregister(info->cmtd);
		if (info->nr_parts)
			kfree(info->parts);
		if (info->cmtd != info->mtd[0])
			mtd_concat_destroy(info->cmtd);
	}

	for (i = 0; i < MAX_RESOURCES; i++) {
		if (info->mtd[i] != NULL)
			map_destroy(info->mtd[i]);
	}

	if (physmap_data->exit)
		physmap_data->exit(dev);

	return 0;
}
static void __exit cleanup_autcpu12_maps(void)
{
	if (sram_mtd) {
		mtd_device_unregister(sram_mtd);
		map_destroy(sram_mtd);
		iounmap((void *)autcpu12_sram_map.virt);
	}
}
示例#12
0
static void __exit cleanup_dc21285(void)
{
	mtd_device_unregister(dc21285_mtd);
	if (dc21285_parts)
		kfree(dc21285_parts);
	map_destroy(dc21285_mtd);
	iounmap(dc21285_map.virt);
}
示例#13
0
static void __exit cleanup_mtdram(void)
{
	if (mtd_info) {
		mtd_device_unregister(mtd_info);
		vfree(mtd_info->priv);
		kfree(mtd_info);
	}
}
示例#14
0
文件: main.c 项目: 3null/linux
static int bcm47xxnflash_remove(struct platform_device *pdev)
{
	struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev);

	if (nflash->mtd)
		mtd_device_unregister(nflash->mtd);

	return 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);
	mtd_device_unregister(state->mtd);
	map_destroy(state->mtd);
	kfree(state);
	return 0;
}
static int autcpu12_nvram_remove(struct platform_device *pdev)
{
	struct autcpu12_nvram_priv *priv = platform_get_drvdata(pdev);

	mtd_device_unregister(priv->mtd);
	map_destroy(priv->mtd);

	return 0;
}
示例#17
0
static int __devexit bcm47xxsflash_remove(struct platform_device *pdev)
{
	struct bcma_sflash *sflash = dev_get_platdata(&pdev->dev);

	mtd_device_unregister(sflash->mtd);
	kfree(sflash->mtd);

	return 0;
}
示例#18
0
static void ox820_nand_exit(void)
{
	if (priv.mtd) {
//		del_mtd_device(priv.mtd);
		mtd_device_unregister(priv.mtd);
		nand_release(priv.mtd);
		kfree(priv.mtd);
	}
}
示例#19
0
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)
		uclinux_ram_map.virt = 0;
}
示例#20
0
static int nxp_spifi_remove(struct platform_device *pdev)
{
    struct nxp_spifi *spifi = platform_get_drvdata(pdev);

    mtd_device_unregister(&spifi->mtd);
    clk_disable_unprepare(spifi->clk_spifi);
    clk_disable_unprepare(spifi->clk_reg);

    return 0;
}
示例#21
0
static int __devexit sst25l_remove(struct spi_device *spi)
{
	struct sst25l_flash *flash = dev_get_drvdata(&spi->dev);
	int ret;

	ret = mtd_device_unregister(&flash->mtd);
	if (ret == 0)
		kfree(flash);
	return ret;
}
示例#22
0
static void cleanup_sbc_gxx(void)
{
	if( all_mtd ) {
		mtd_device_unregister(all_mtd);
		map_destroy( all_mtd );
	}

	iounmap(iomapadr);
	release_region(PAGE_IO,PAGE_IO_SIZE);
}
示例#23
0
static void __exit cleanup_sc520cdp(void)
{
	int i;

	if (merged_mtd) {
		mtd_device_unregister(merged_mtd);
		mtd_concat_destroy(merged_mtd);
	}
	if (mymtd[2])
		mtd_device_unregister(mymtd[2]);

	for (i = 0; i < NUM_FLASH_BANKS; i++) {
		if (mymtd[i])
			map_destroy(mymtd[i]);
		if (sc520cdp_map[i].virt) {
			iounmap(sc520cdp_map[i].virt);
			sc520cdp_map[i].virt = NULL;
		}
	}
}
示例#24
0
static void __exit cleanup_mbx(void)
{
	if (mymtd) {
		mtd_device_unregister(mymtd);
		map_destroy(mymtd);
	}
	if (mbx_map.virt) {
		iounmap((void *)mbx_map.virt);
		mbx_map.virt = 0;
	}
}
示例#25
0
static int
ltq_mtd_remove(struct platform_device *pdev)
{
	struct ltq_mtd *ltq_mtd = platform_get_drvdata(pdev);

	if (ltq_mtd && ltq_mtd->mtd) {
		mtd_device_unregister(ltq_mtd->mtd);
		map_destroy(ltq_mtd->mtd);
	}
	return 0;
}
示例#26
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;
	}
}
示例#27
0
static void __exit cleanup_flagadm(void)
{
	if (mymtd) {
		mtd_device_unregister(mymtd);
		map_destroy(mymtd);
	}
	if (flagadm_map.virt) {
		iounmap((void __iomem *)flagadm_map.virt);
		flagadm_map.virt = NULL;
	}
}
示例#28
0
static void __exit cleanup_dbox2_flash(void)
{
	if (mymtd) {
		mtd_device_unregister(mymtd);
		map_destroy(mymtd);
	}
	if (dbox2_flash_map.virt) {
		iounmap((void *)dbox2_flash_map.virt);
		dbox2_flash_map.virt = 0;
	}
}
示例#29
0
static void __exit cleanup_netsc520(void)
{
	if (mymtd) {
		mtd_device_unregister(mymtd);
		map_destroy(mymtd);
	}
	if (netsc520_map.virt) {
		iounmap(netsc520_map.virt);
		netsc520_map.virt = NULL;
	}
}
示例#30
0
static void __exit cleanup_epcsmap(void)
{
	if (mymtd) {
		mtd_device_unregister(mymtd);
		map_destroy(mymtd);
	}
	if (mtd_parts)
		kfree(mtd_parts);
	iounmap(alt_epcs_map.virt);
	alt_epcs_map.virt = NULL;
}