···831831 break;832832833833 case NAND_CMD_READID:834834+ host->col_addr = 0;834835 send_read_id(host);835836 break;836837···868867 mtd->priv = this;869868 mtd->owner = THIS_MODULE;870869 mtd->dev.parent = &pdev->dev;870870+ mtd->name = "mxc_nand";871871872872 /* 50 us command delay time */873873 this->chip_delay = 5;···884882 this->verify_buf = mxc_nand_verify_buf;885883886884 host->clk = clk_get(&pdev->dev, "nfc");887887- if (IS_ERR(host->clk))885885+ if (IS_ERR(host->clk)) {886886+ err = PTR_ERR(host->clk);888887 goto eclk;888888+ }889889890890 clk_enable(host->clk);891891 host->clk_act = 1;···900896901897 host->regs = ioremap(res->start, res->end - res->start + 1);902898 if (!host->regs) {903903- err = -EIO;899899+ err = -ENOMEM;904900 goto eres;905901 }906902···10151011#ifdef CONFIG_PM10161012static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state)10171013{10181018- struct mtd_info *info = platform_get_drvdata(pdev);10141014+ struct mtd_info *mtd = platform_get_drvdata(pdev);10151015+ struct nand_chip *nand_chip = mtd->priv;10161016+ struct mxc_nand_host *host = nand_chip->priv;10191017 int ret = 0;1020101810211019 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n");10221022- if (info)10231023- ret = info->suspend(info);10241024-10251025- /* Disable the NFC clock */10261026- clk_disable(nfc_clk); /* FIXME */10201020+ if (mtd) {10211021+ ret = mtd->suspend(mtd);10221022+ /* Disable the NFC clock */10231023+ clk_disable(host->clk);10241024+ }1027102510281026 return ret;10291027}1030102810311029static int mxcnd_resume(struct platform_device *pdev)10321030{10331033- struct mtd_info *info = platform_get_drvdata(pdev);10311031+ struct mtd_info *mtd = platform_get_drvdata(pdev);10321032+ struct nand_chip *nand_chip = mtd->priv;10331033+ struct mxc_nand_host *host = nand_chip->priv;10341034 int ret = 0;1035103510361036 DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n");10371037- /* Enable the NFC clock */10381038- clk_enable(nfc_clk); /* FIXME */1039103710401040- if (info)10411041- info->resume(info);10381038+ if (mtd) {10391039+ /* Enable the NFC clock */10401040+ clk_enable(host->clk);10411041+ mtd->resume(mtd);10421042+ }1042104310431044 return ret;10441045}···1064105510651056static int __init mxc_nd_init(void)10661057{10671067- /* Register the device driver structure. */10681068- pr_info("MXC MTD nand Driver\n");10691069- if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) {10701070- printk(KERN_ERR "Driver register failed for mxcnd_driver\n");10711071- return -ENODEV;10721072- }10731073- return 0;10581058+ return platform_driver_probe(&mxcnd_driver, mxcnd_probe);10741059}1075106010761061static void __exit mxc_nd_cleanup(void)
-7
fs/jffs2/erase.c
···480480 return;481481482482filebad:483483- mutex_lock(&c->erase_free_sem);484484- spin_lock(&c->erase_completion_lock);485485- /* Stick it on a list (any list) so erase_failed can take it486486- right off again. Silly, but shouldn't happen often. */487487- list_move(&jeb->list, &c->erasing_list);488488- spin_unlock(&c->erase_completion_lock);489489- mutex_unlock(&c->erase_free_sem);490483 jffs2_erase_failed(c, jeb, bad_offset);491484 return;492485