[PATCH v2] mtd: rawnand: tango: Fix struct clk memory leak
Miquel Raynal
miquel.raynal at bootlin.com
Thu Apr 5 07:22:33 PDT 2018
Hi Marc,
On Thu, 5 Apr 2018 14:57:59 +0200, Marc Gonzalez
<marc_gonzalez at sigmadesigns.com> wrote:
> 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);
>
Reviewed-by: Miquel Raynal <miquel.raynal at bootlin.com>
Thanks,
Miquèl
--
Miquel Raynal, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
More information about the linux-mtd
mailing list