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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mark, again

> > > +	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?
> 
> Good catch.
> This came from original simple-card, but yes, we should use devm_*
> I will fix it on v3

Oops, of_clk_get() doesn't have devm_of_clk_get() ?
(and no of_clk_put() ... )
I will keep above as-is in v3. We can fix it incrementally (?)



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux