mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
mtd: rawnand: oxnas: Release all devices in the _remove() path
commit0a5f45e57eupstream. oxnans_nand_remove() should release all MTD devices and clean all NAND devices, not only the first one registered. Fixes:6685924924("mtd: nand: Add OX820 NAND Support") Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200519130035.1883-39-miquel.raynal@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f8a2658d0f
commit
cc490ea23f
@@ -177,9 +177,13 @@ err_clk_unprepare:
|
||||
static int oxnas_nand_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct oxnas_nand_ctrl *oxnas = platform_get_drvdata(pdev);
|
||||
struct nand_chip *chip;
|
||||
int i;
|
||||
|
||||
if (oxnas->chips[0])
|
||||
nand_release(oxnas->chips[0]);
|
||||
for (i = 0; i < oxnas->nchips; i++) {
|
||||
chip = oxnas->chips[i];
|
||||
nand_release(chip);
|
||||
}
|
||||
|
||||
clk_disable_unprepare(oxnas->clk);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user