static void __exit cs553x_cleanup(void)
{
	int i;

	for (i = 0; i < NR_CS553X_CONTROLLERS; i++) {
		struct mtd_info *mtd = cs553x_mtd[i];
		struct nand_chip *this;
		void __iomem *mmio_base;

		if (!mtd)
			continue;

		this = cs553x_mtd[i]->priv;
		mmio_base = this->IO_ADDR_R;

		
		nand_release(cs553x_mtd[i]);
		kfree(cs553x_mtd[i]->name);
		cs553x_mtd[i] = NULL;

		
		iounmap(mmio_base);

		
		kfree(mtd);
	}
}
Beispiel #2
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;

		nand_release(mtd);
		kfree(drvdata->parts[i]);
		kfree(txx9_priv->mtdname);
		kfree(txx9_priv);
	}
	return 0;
}
Beispiel #3
0
static void __exit cs553x_cleanup(void)
{
	int i;

	for (i = 0; i < NR_CS553X_CONTROLLERS; i++) {
		struct mtd_info *mtd = cs553x_mtd[i];
		struct nand_chip *this;
		void __iomem *mmio_base;

		if (!mtd)
			break;

		this = cs553x_mtd[i]->priv;
		mmio_base = this->IO_ADDR_R;

		/* Release resources, unregister device */
		nand_release(cs553x_mtd[i]);
		cs553x_mtd[i] = NULL;

		/* unmap physical adress */
		iounmap(mmio_base);

		/* Free the MTD device structure */
		kfree(mtd);
	}
}
Beispiel #4
0
/*
 * Remove NAND device.
 */
static int __devexit lpc32xx_nand_remove(struct platform_device *pdev)
{
	u32 tmp;
	struct lpc32xx_nand_host *host = platform_get_drvdata(pdev);
	struct mtd_info *mtd = &host->mtd;

	nand_release(mtd);

	/* Free the DMA channel used by us */
	lpc32xx_dma_ch_disable(host->dmach);
	lpc32xx_dma_dealloc_llist(host->dmach);
	lpc32xx_dma_ch_put(host->dmach);
	host->dmach = -1;

	dma_free_coherent(&pdev->dev, host->dma_buf_len,
		host->data_buf, host->data_buf_dma);

	/* Force CE high */
	tmp = __raw_readl(SLC_CTRL(host->io_base));
	tmp &= ~SLCCFG_CE_LOW;
	__raw_writel(tmp, SLC_CTRL(host->io_base));

	lpc32xx_wp_enable(host);
	clk_disable(host->clk);
	clk_put(host->clk);

	iounmap(host->io_base);

	kfree(host);

	return 0;
}
/*
 * Remove a NAND device.
 */
static int __devexit stm_nand_emi_remove(struct platform_device *pdev)
{
	struct stm_nand_emi *data = platform_get_drvdata(pdev);
	struct platform_nand_data *pdata = pdev->dev.platform_data;

	nand_release(&data->mtd);

	if (data->rbn)
		stpio_free_pin(data->rbn);

#ifdef CONFIG_MTD_PARTITIONS
	if (data->parts && data->parts != pdata->chip.partitions)
		kfree(data->parts);
#endif
	platform_set_drvdata(pdev, NULL);
	iounmap(data->io_addr);
	iounmap(data->io_cmd);
#ifdef CONFIG_STM_NAND_EMI_CACHED
	iounmap(data->io_data);
#endif
	iounmap(data->io_base);
	release_mem_region(data->emi_base, data->emi_size);
#ifdef CONFIG_STM_NAND_EMI_FDMA
	exit_fdma_nand(data);
#endif
	kfree(data);

	return 0;
}
Beispiel #6
0
/*
 * Remove a NAND device.
 */
static int xway_nand_remove(struct platform_device *pdev)
{
	struct xway_nand_data *data = platform_get_drvdata(pdev);

	nand_release(nand_to_mtd(&data->chip));

	return 0;
}
Beispiel #7
0
static int bcm47xxnflash_remove(struct platform_device *pdev)
{
	struct bcm47xxnflash *nflash = platform_get_drvdata(pdev);

	nand_release(nand_to_mtd(&nflash->nand_chip));

	return 0;
}
Beispiel #8
0
static int __devexit ndfc_remove(struct of_device *ofdev)
{
	struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);

	nand_release(&ndfc->mtd);

	return 0;
}
Beispiel #9
0
static void ox820_nand_exit(void)
{
	if (priv.mtd) {
		del_mtd_device(priv.mtd);
		nand_release(priv.mtd);
		kfree(priv.mtd);
	}
}
Beispiel #10
0
/*
 * Clean up routine
 */
static void __exit ams_delta_cleanup(void)
{
    /* Release resources, unregister device */
    nand_release(ams_delta_mtd);

    /* Free the MTD device structure */
    kfree(ams_delta_mtd);
}
static int __devexit ndfc_remove(struct platform_device *ofdev)
{
	struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);

	nand_release(&ndfc->mtd);
	kfree(ndfc->mtd.name);

	return 0;
}
Beispiel #12
0
static int ea1788_nand_remove(struct platform_device *dev)
{
	if (ea1788_mtd) {
		nand_release(ea1788_mtd);
		iounmap(ea1788_nand_base);
		kfree(ea1788_mtd);
	}
	return 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);
	}
}
/*
 * Clean up routine
 */
static void __exit ppchameleonevb_cleanup(void)
{
	struct nand_chip *this;

	/* Release resources, unregister device(s) */
	nand_release(ppchameleon_mtd);
	nand_release(ppchameleonevb_mtd);

	/* Release iomaps */
	this = (struct nand_chip *) &ppchameleon_mtd[1];
	iounmap((void *) this->IO_ADDR_R);
	this = (struct nand_chip *) &ppchameleonevb_mtd[1];
	iounmap((void *) this->IO_ADDR_R);

	/* Free the MTD device structure */
	kfree (ppchameleon_mtd);
	kfree (ppchameleonevb_mtd);
}
Beispiel #15
0
static int ndfc_remove(struct platform_device *ofdev)
{
	struct ndfc_controller *ndfc = dev_get_drvdata(&ofdev->dev);
	struct mtd_info *mtd = nand_to_mtd(&ndfc->chip);

	nand_release(mtd);
	kfree(mtd->name);

	return 0;
}
Beispiel #16
0
/*
 * Clean up routine
 */
static void __exit sharpsl_nand_cleanup(void)
{
	/* Release resources, unregister device */
	nand_release(sharpsl_mtd);

	iounmap(sharpsl_io_base);

	/* Free the MTD device structure */
	kfree(sharpsl_mtd);
}
Beispiel #17
0
/*
 * Remove a NAND device.
 */
static int plat_nand_remove(struct platform_device *pdev)
{
	struct plat_nand_data *data = platform_get_drvdata(pdev);
	struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev);

	nand_release(nand_to_mtd(&data->chip));
	if (pdata->ctrl.remove)
		pdata->ctrl.remove(pdev);

	return 0;
}
Beispiel #18
0
static int omap_nand_remove(struct platform_device *pdev)
{
	struct omap_nand_info *info = platform_get_drvdata(pdev);

	platform_set_drvdata(pdev, NULL);
	/* Release NAND device, its internal structures and partitions */
	nand_release(&info->mtd);
	iounmap(info->nand.IO_ADDR_R);
	kfree(info);
	return 0;
}
static int simcom_nand_remove(struct platform_device *pdev)
{
	/* Release resources, unregister device */
	nand_release(simcom_nand_mtd);
	iounmap(simcom_nand_io);

	/* Free the MTD device structure */
	kfree (simcom_nand_mtd);

	return 0;
}
Beispiel #20
0
/*
 * Clean up routine
 */
static void __exit autcpu12_cleanup(void)
{
	/* Release resources, unregister device */
	nand_release(autcpu12_mtd);

	/* unmap physical address */
	iounmap(autcpu12_fio_base);

	/* Free the MTD device structure */
	kfree(autcpu12_mtd);
}
static void __exit autcpu12_cleanup(void)
{
	/*                                      */
	nand_release(autcpu12_mtd);

	/*                        */
	iounmap(autcpu12_fio_base);

	/*                               */
	kfree(autcpu12_mtd);
}
Beispiel #22
0
/*
 * Clean up routine
 */
static void __exit ep7312_cleanup(void)
{
	struct nand_chip *this = (struct nand_chip *)&ep7312_mtd[1];

	/* Release resources, unregister device */
	nand_release(ap7312_mtd);

	/* Release io resource */
	iounmap(this->IO_ADDR_R);

	/* Free the MTD device structure */
	kfree(ep7312_mtd);
}
int nremove(struct platform_device *pdev)
{
	struct nand_info *nand = platform_get_drvdata(pdev);	
	
	nand_exit(nand);
	clk_disable(nand->clk);
	clk_put(nand->clk);
	nand_release(&nand->mtd);
	iounmap(nand->virt);
	kfree(nand);
	
	return 0;
}
Beispiel #24
0
static int tmio_remove(struct platform_device *dev)
{
	struct tmio_nand *tmio = platform_get_drvdata(dev);

	nand_release(&tmio->mtd);
	if (tmio->irq)
		free_irq(tmio->irq, tmio);
	tmio_hw_stop(dev, tmio);
	iounmap(tmio->fcr);
	iounmap(tmio->ccr);
	kfree(tmio);
	return 0;
}
Beispiel #25
0
static void __exit lpc2468_ea_nand_cleanup(void)
{
	if(lpc2468_ea_nand_mtd != NULL) {
		/* Release resources, unregister device */
		nand_release(lpc2468_ea_nand_mtd);

		/* Unmap physical adress */
		iounmap(lpc2468_ea_nand_base);

		/* Free the MTD device structure */
		kfree(lpc2468_ea_nand_mtd);
	}
}
Beispiel #26
0
/*
 * Clean up routine
 */
static void __exit h1910_cleanup (void)
{
	struct nand_chip *this = (struct nand_chip *) &h1910_nand_mtd[1];
	
	/* Release resources, unregister device */
	nand_release (h1910_nand_mtd);

	/* Release io resource */
	iounmap ((void *) this->IO_ADDR_W);

	/* Free the MTD device structure */
	kfree (h1910_nand_mtd);
}
Beispiel #27
0
/*
 * Clean up routine
 */
static void __exit ep7312_cleanup (void)
{
    struct nand_chip *this = (struct nand_chip *) &ep7312_mtd[1];

    /* Release resources, unregister device */
    nand_release (ap7312_mtd);

    /* Free internal data buffer */
    kfree (this->data_buf);

    /* Free the MTD device structure */
    kfree (ep7312_mtd);
}
Beispiel #28
0
/*
 * Clean up routine
 */
static void __exit toto_cleanup (void)
{
	/* Release resources, unregister device */
	nand_release (toto_mtd);

	/* Free the MTD device structure */
	kfree (toto_mtd);

	/* stop flash writes */
	 archflashwp(0,1);
	
	/* release gpios to system */
	 gpiorelease(NAND_MASK);
}
/*
 * Remove a NAND device.
 */
static int __devexit at91_nand_remove(struct platform_device *pdev)
{
	struct at91_nand_host *host = platform_get_drvdata(pdev);
	struct mtd_info *mtd = &host->mtd;

	nand_release(mtd);

	at91_nand_disable(host);

	iounmap(host->io_base);
	kfree(host);

	return 0;
}
Beispiel #30
0
void my_nand_exit(void)
{
	nand_release(s5pv210_mtd);  

	kfree(s5pv210_mtd);  
	
	kfree(s5pv210_nand);  

	clk_disable(s5pv210_nand_clk);  

	if(s5pv210_nand_regs == NULL)  
		iounmap(s5pv210_nand_regs);  

	iounmap(mp06con);
}