nfc = platform_get_drvdata(pdev);
if (nfc) {
mtd = ar934x_nfc_to_mtd(nfc);
- nand_release(mtd);
+ nand_release(&nfc->nand_chip);
ar934x_nfc_free_buf(nfc);
free_irq(nfc->irq, nfc);
}
return 0;
err_release_nand:
- nand_release(mtd);
+ nand_release(&info->chip);
err_set_drvdata:
platform_set_drvdata(pdev, NULL);
err_free_info:
{
struct rb4xx_nand_info *info = platform_get_drvdata(pdev);
- nand_release(rbinfo_to_mtd(info));
+ nand_release(&info->chip));
platform_set_drvdata(pdev, NULL);
kfree(info);
gpio_free(RB4XX_NAND_GPIO_NCE);
return 0;
err_release_nand:
- nand_release(mtd);
+ nand_release(&info->chip);
err_set_drvdata:
platform_set_drvdata(pdev, NULL);
err_free_info:
{
struct rb750_nand_info *info = platform_get_drvdata(pdev);
- nand_release(rbinfo_to_mtd(info));
+ nand_release(&info->chip);
platform_set_drvdata(pdev, NULL);
kfree(info);
return 0;
err_release_nand:
- nand_release(mtd);
+ nand_release(&rbni->chip);
return ret;
}
{
struct rb91x_nand_info *info = platform_get_drvdata(pdev);
- nand_release(rbinfo_to_mtd(info));
+ nand_release(&rbni->chip);
return 0;
}
+ if (!ret)
+ return 0;
+
-+ nand_release(mtd);
++ nand_release(this);
+ return -EINVAL;
+}
+
+{
+ struct bcm2835_smi_nand_host *host = platform_get_drvdata(pdev);
+
-+ nand_release(&host->mtd);
++ nand_release(&host->nand_chip);
+
+ return 0;
+}
+
+out:
+ MSG(INIT, "[NFI] mtk_nand_probe fail, err = %d!\n", err);
-+ nand_release(mtd);
++ nand_release(nand_chip);
+ platform_set_drvdata(pdev, NULL);
+ kfree(host);
+ nand_disable_clock();
+ struct mtd_info *mtd = host->mtd;
+ struct nand_chip *nand_chip = &host->nand_chip;
+
-+ nand_release(mtd);
++ nand_release(nand_chip);
+ kfree(host);
+ nand_disable_clock();
+
static int s5p_nand_remove(struct platform_device *pdev)
{
struct s5p_nand_host *host = platform_get_drvdata(pdev);
- struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
- nand_release(mtd);
+ nand_release(&host->nand_chip);
clk_disable_unprepare(host->clk[0]); /* nandxl */
clk_disable_unprepare(host->clk[1]); /* nand */