예제 #1
0
static int bast_flash_remove(struct platform_device *pdev)
{
	struct bast_flash_info *info = platform_get_drvdata(pdev);

	platform_set_drvdata(pdev, NULL);

	if (info == NULL)
		return 0;

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

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

	kfree(info->partitions);

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

	kfree(info);

	return 0;
}
예제 #2
0
파일: nand.c 프로젝트: uwyyk/LINUX_DRIVERS
static void s3c6410_nand_exit(void)
{
	del_mtd_partitions(s3c_mtd);
	kfree(s3c_mtd);
	kfree(s3c_nand);
	iounmap(s3c_nand_regs);
}
예제 #3
0
static void __exit cleanup_pnc2000(void)
{
	if (mymtd) {
		del_mtd_partitions(mymtd);
		map_destroy(mymtd);
	}
}
예제 #4
0
static int __devexit omap2_onenand_remove(struct platform_device *pdev)
{
	struct omap2_onenand *c = dev_get_drvdata(&pdev->dev);

	BUG_ON(c == NULL);

#ifdef CONFIG_MTD_PARTITIONS
	if (c->parts)
		del_mtd_partitions(&c->mtd);
	else
		del_mtd_device(&c->mtd);
#else
	del_mtd_device(&c->mtd);
#endif

	onenand_release(&c->mtd);
	if (c->dma_channel != -1)
		omap_free_dma(c->dma_channel);
	omap2_onenand_shutdown(pdev);
	platform_set_drvdata(pdev, NULL);
	if (c->gpio_irq) {
		free_irq(gpio_to_irq(c->gpio_irq), c);
		gpio_free(c->gpio_irq);
	}
	iounmap(c->onenand.base);
	release_mem_region(c->phys_base, ONENAND_IO_SIZE);
	gpmc_cs_free(c->gpmc_cs);
	kfree(c);

	return 0;
}
예제 #5
0
파일: physmap_of.c 프로젝트: E-LLP/n900
static int of_flash_remove(struct of_device *dev)
{
	struct of_flash *info;

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

	if (info->mtd) {
		if (OF_FLASH_PARTS(info)) {
			del_mtd_partitions(info->mtd);
			kfree(OF_FLASH_PARTS(info));
		} else {
			del_mtd_device(info->mtd);
		}
		map_destroy(info->mtd);
	}

	if (info->map.virt)
		iounmap(info->map.virt);

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

	return 0;
}
예제 #6
0
static int ixp2000_flash_remove(struct device *_dev)
{
	struct platform_device *dev = to_platform_device(_dev);
	struct flash_platform_data *plat = dev->dev.platform_data;
	struct ixp2000_flash_info *info = dev_get_drvdata(&dev->dev);

	dev_set_drvdata(&dev->dev, NULL);

	if(!info)
		return 0;

	if (info->mtd) {
		del_mtd_partitions(info->mtd);
		map_destroy(info->mtd);
	}
	if (info->map.map_priv_1)
		iounmap((void *) info->map.map_priv_1);

	if (info->partitions) {
		kfree(info->partitions); }

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

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

	return 0;
}
예제 #7
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) {
		del_mtd_partitions(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;
}
예제 #8
0
static int __devexit
armadillo_mtd_remove(struct platform_device *pdev)
{
	struct armadillo_flash_info *info = platform_get_drvdata(pdev);

	platform_set_drvdata(pdev, NULL);

	if (info) {
		if (info->mtd) {
			del_mtd_partitions(info->mtd);
			map_destroy(info->mtd);
		}
		if (info->parts)
			kfree(info->parts);

		release_resource(info->res);
		kfree(info->res);

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

		kfree(info);
	}

	return 0;
}
예제 #9
0
static void __exit cleanup_txmtd(void)
{
	int i, j;
        struct mtd_info *mymtd;

	for (i=0;i<PHYSMAP_NUMBER;i++) {
	        mymtd = tx4938_desc[i].mtd_info;
		if (mymtd) {
#ifdef CONFIG_MTD_PARTITIONS
			del_mtd_partitions(mymtd);
#else
			del_mtd_device(mymtd);
#endif
			map_destroy(mymtd);
		}
		if (tx4938_maps[i].virt) {
			iounmap((void *)tx4938_maps[i].virt);
			tx4938_maps[i].virt = 0;
		}
#ifdef CONFIG_MTD_PARTITIONS
		for (j = 0; j < MAX_PHYSMAP_PARTITIONS; j++) {
			if (tx4938_desc[i].part_names[j])
				kfree(tx4938_desc[i].part_names[j]);
			tx4938_desc[i].part_names[j] = 0;
		}
#endif
	}
}
예제 #10
0
static int of_physmap_remove(struct of_device *dev)
{
	struct physmap_flash_info *info;

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

	if (info->mtd != NULL) {
#ifdef CONFIG_MTD_PARTITIONS
		if (info->nr_parts) {
			del_mtd_partitions(info->mtd);
			kfree(info->parts);
		} else {
			del_mtd_device(info->mtd);
		}
#else
		del_mtd_device(info->mtd);
#endif
		map_destroy(info->mtd);
	}

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

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

	return 0;
}
예제 #11
0
static int __exit txx9ndfmc_remove(struct platform_device *dev)
{
	struct txx9ndfmc_drvdata *drvdata = platform_get_drvdata(dev);
	int i;

	platform_set_drvdata(dev, NULL);
	if (!drvdata)
		return 0;
	for (i = 0; i < MAX_TXX9NDFMC_DEV; i++) {
		struct mtd_info *mtd = drvdata->mtds[i];
		struct nand_chip *chip;
		struct txx9ndfmc_priv *txx9_priv;

		if (!mtd)
			continue;
		chip = mtd->priv;
		txx9_priv = chip->priv;

#ifdef CONFIG_MTD_PARTITIONS
		del_mtd_partitions(mtd);
		kfree(drvdata->parts[i]);
#endif
		del_mtd_device(mtd);
		kfree(txx9_priv->mtdname);
		kfree(txx9_priv);
	}
	return 0;
}
예제 #12
0
static void armflash_cfi_exit(void)
{
	if (mtd) {
		del_mtd_partitions(mtd);
		map_destroy(mtd);
	}
}
예제 #13
0
static void __exit pb1xxx_mtd_cleanup(void)
{
	if (pb1xxx_mtd) {
		del_mtd_partitions(pb1xxx_mtd);
		map_destroy(pb1xxx_mtd);
		iounmap((void *) pb1xxx_mtd_map.virt);
	}
}
예제 #14
0
static void __exit cleanup_dnpc(void)
{
	if(merged_mtd) {
		del_mtd_partitions(merged_mtd);
		mtd_concat_destroy(merged_mtd);
	}

	if (mymtd) {
		del_mtd_partitions(mymtd);
		map_destroy(mymtd);
	}
	if (dnpc_map.virt) {
		iounmap(dnpc_map.virt);
		dnpc_unmap_flash();
		dnpc_map.virt = NULL;
	}
}
예제 #15
0
파일: lart.c 프로젝트: smx-smx/dsl-n55u
void __exit lart_flash_exit (void)
{
#ifndef HAVE_PARTITIONS
   del_mtd_device (&mtd);
#else
   del_mtd_partitions (&mtd);
#endif
}
예제 #16
0
static void __exit alchemy_mtd_cleanup(void)
{
	if (mymtd) {
		del_mtd_partitions(mymtd);
		map_destroy(mymtd);
		iounmap(alchemy_map.virt);
	}
}
예제 #17
0
파일: mpc1211.c 프로젝트: maliyu/SOM2416
static void __exit cleanup_mpc1211_maps(void)
{
	if (parsed_parts)
		del_mtd_partitions(flash_mtd);
	else
		del_mtd_device(flash_mtd);
	map_destroy(flash_mtd);
}
예제 #18
0
static void __exit db1550_mtd_cleanup(void)
{
	if (mymtd) {
		del_mtd_partitions(mymtd);
		map_destroy(mymtd);
		iounmap((void *) db1550_map.virt);
	}
}
예제 #19
0
static void  __exit omap_toto_mtd_cleanup(void)
{
	if (flash_mtd) {
		del_mtd_partitions(flash_mtd);
		map_destroy(flash_mtd);
		kfree(parsed_parts);
	}
}
예제 #20
0
static void __exit
nflash_mtd_exit(void)
{
#ifdef CONFIG_MTD_PARTITIONS
	del_mtd_partitions(&nflash.mtd);
#else
	del_mtd_device(&nflash.mtd);
#endif
}
예제 #21
0
static void __exit
cleanup_beech_mtd(void)
{
	if (beech_mtd) {
		del_mtd_partitions(beech_mtd);
		map_destroy(beech_mtd);
		iounmap((void *) beech_mtd_map.virt);
	}
}
static void __exit db1x00_mtd_cleanup(void)
{
	if (db1xxx_mtd) {
		del_mtd_partitions(db1xxx_mtd);
		map_destroy(db1xxx_mtd);
		if (parsed_parts)
			kfree(parsed_parts);
	}
}
예제 #23
0
static void cleanup_elan_104nc(void)
{
	if( all_mtd ) {
		del_mtd_partitions( all_mtd );
		map_destroy( all_mtd );
	}

	iounmap(iomapadr);
}
예제 #24
0
static void __exit
cleanup_arctic_mtd(void)
{
	if (arctic_mtd) {
		del_mtd_partitions(arctic_mtd);
		map_destroy(arctic_mtd);
		iounmap((void *) arctic_mtd_map.virt);
	}
}
예제 #25
0
static void __exit cleanup_redwood_flash(void)
{
	if (redwood_mtd) {
		del_mtd_partitions(redwood_mtd);
		/* moved iounmap after map_destroy - armin */
		map_destroy(redwood_mtd);
		iounmap((void *)redwood_flash_map.virt);
	}
}
예제 #26
0
static void __exit mtx1_mtd_cleanup(void)
{
	if (mtx1_mtd) {
		del_mtd_partitions(mtx1_mtd);
		map_destroy(mtx1_mtd);
	}
	if (mtx1_map.virt)
		iounmap(mtx1_map.virt);
}
예제 #27
0
static void __exit epxa10db_mtd_cleanup(void)
{
	if (mymtd) {
		del_mtd_partitions(mymtd);
		map_destroy(mymtd);
		if (parsed_parts)
			kfree(parsed_parts);
	}
}
예제 #28
0
static void __devexit vr_nor_destroy_partitions(struct vr_nor_mtd *p)
{
	if (p->nr_parts > 0) {
#if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE)
		del_mtd_partitions(p->info);
#endif
	} else
		del_mtd_device(p->info);
}
예제 #29
0
static void cleanup_sbc_gxx(void)
{
	if( all_mtd ) {
		del_mtd_partitions( all_mtd );
		map_destroy( all_mtd );
	}

	iounmap(iomapadr);
	release_region(PAGE_IO,PAGE_IO_SIZE);
}
static void __exit cleanup_lasat(void)
{
	if (lasat_mtd) {
		del_mtd_partitions(lasat_mtd);
		map_destroy(lasat_mtd);
	}
	if (lasat_map.virt) {
		lasat_map.virt = 0;
	}
}