[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <160453619129.3965362.7473462251338349415@swboyd.mtv.corp.google.com>
Date: Wed, 04 Nov 2020 16:29:51 -0800
From: Stephen Boyd <sboyd@...nel.org>
To: Michael Walle <michael@...le.cc>, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Michael Turquette <mturquette@...libre.com>,
Michael Walle <michael@...le.cc>
Subject: Re: [PATCH] clk: fsl-sai: fix memory leak
Quoting Michael Walle (2020-11-01 10:48:18)
> diff --git a/drivers/clk/clk-fsl-sai.c b/drivers/clk/clk-fsl-sai.c
> index 0221180a4dd7..1e81c8d8a6fd 100644
> --- a/drivers/clk/clk-fsl-sai.c
> +++ b/drivers/clk/clk-fsl-sai.c
> @@ -68,9 +68,20 @@ static int fsl_sai_clk_probe(struct platform_device *pdev)
> if (IS_ERR(hw))
> return PTR_ERR(hw);
>
> + platform_set_drvdata(pdev, hw);
> +
> return devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, hw);
> }
>
> +static int fsl_sai_clk_remove(struct platform_device *pdev)
> +{
> + struct clk_hw *hw = platform_get_drvdata(pdev);
> +
> + clk_hw_unregister_composite(hw);
Should we add a devm_clk_hw_register_composite() API and use it here?
That way we don't need a remove function and devm can be used
throughout.
> +
> + return 0;
> +}
> +
> static const struct of_device_id of_fsl_sai_clk_ids[] = {
> { .compatible = "fsl,vf610-sai-clock" },
> { }
Powered by blists - more mailing lists