mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 21:44:06 +08:00
mtd: rawnand: sunxi: Stop using nand_release()
This helper is not very useful and very often people get confused: they use nand_release() instead of nand_cleanup(). Let's stop using nand_release() by calling mtd_device_unregister() and nand_cleanup() directly. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-55-miquel.raynal@bootlin.com
This commit is contained in:
parent
3d84515ffd
commit
068d86ecd9
@ -2039,13 +2039,18 @@ static int sunxi_nand_chips_init(struct device *dev, struct sunxi_nfc *nfc)
|
||||
static void sunxi_nand_chips_cleanup(struct sunxi_nfc *nfc)
|
||||
{
|
||||
struct sunxi_nand_chip *sunxi_nand;
|
||||
struct nand_chip *chip;
|
||||
int ret;
|
||||
|
||||
while (!list_empty(&nfc->chips)) {
|
||||
sunxi_nand = list_first_entry(&nfc->chips,
|
||||
struct sunxi_nand_chip,
|
||||
node);
|
||||
nand_release(&sunxi_nand->nand);
|
||||
sunxi_nand_ecc_cleanup(&sunxi_nand->nand.ecc);
|
||||
chip = &sunxi_nand->nand;
|
||||
ret = mtd_device_unregister(nand_to_mtd(chip));
|
||||
WARN_ON(ret);
|
||||
nand_cleanup(chip);
|
||||
sunxi_nand_ecc_cleanup(&chip->ecc);
|
||||
list_del(&sunxi_nand->node);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user