[PATCH v2] mtd: rawnand: tango: Fix struct clk memory leak
Marc Gonzalez
marc_gonzalez at sigmadesigns.com
Thu Apr 5 05:57:59 PDT 2018
Use devm_clk_get() to let Linux manage struct clk memory.
Fixes: 6956e2385a16 ("add tango NAND flash controller support")
Reported-by: Xidong Wang <wangxidong_97 at 163.com>
Signed-off-by: Marc Gonzalez <marc_gonzalez at sigmadesigns.com>
---
Missing clk_prepare_enable() would be handled in a separate patch.
---
drivers/mtd/nand/tango_nand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/tango_nand.c b/drivers/mtd/nand/tango_nand.c
index c5bee00b7f5e..76761b841f1f 100644
--- a/drivers/mtd/nand/tango_nand.c
+++ b/drivers/mtd/nand/tango_nand.c
@@ -643,7 +643,7 @@ static int tango_nand_probe(struct platform_device *pdev)
writel_relaxed(MODE_RAW, nfc->pbus_base + PBUS_PAD_MODE);
- clk = clk_get(&pdev->dev, NULL);
+ clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(clk))
return PTR_ERR(clk);
--
2.16.2
More information about the linux-mtd
mailing list