[PATCH v2] mtd: rawnand: tango: Fix struct clk memory leak

Boris Brezillon boris.brezillon at bootlin.com
Tue Apr 24 08:50:17 PDT 2018


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>

Applied.

Thanks,

Boris

> ---
> 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);
>  




More information about the linux-mtd mailing list