[alsa-devel] [PATCH 09/39 v2] ASoC: simple-card-utils: add asoc_simple_card_parse_clk()

Mark Brown broonie at kernel.org
Wed Jun 29 20:18:43 CEST 2016


On Tue, May 31, 2016 at 09:02:22AM +0000, Kuninori Morimoto wrote:

> +	struct clk *clk;
> +	u32 val;
> +
> +	/*
> +	 * Parse dai->sysclk come from "clocks = <&xxx>"
> +	 * (if system has common clock)
> +	 *  or "system-clock-frequency = <xxx>"
> +	 *  or device's module clock.
> +	 */
> +	clk = of_clk_get(port_np, 0);
> +	if (!IS_ERR(clk)) {
> +		simple_dai->sysclk = clk_get_rate(clk);
> +		simple_dai->clk = clk;
> +	} else if (!of_property_read_u32(port_np, "system-clock-frequency", &val)) {
> +		simple_dai->sysclk = val;
> +	} else {
> +		clk = of_clk_get(endpoint_np, 0);
> +		if (!IS_ERR(clk))
> +			simple_dai->sysclk = clk_get_rate(clk);
> +	}

This looks like we're leaking the clocks - devm_ might help here
perhaps?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20160629/fdb8fcf7/attachment.sig>


More information about the Alsa-devel mailing list