Re: [PATCH v3 01/31] spi: mpc512x: cleanup clock API use

2013-07-23 Thread Gerhard Sittig
[ devicetree@vger adjusted ] On Mon, Jul 22, 2013 at 15:09 +0100, Mark Brown wrote: On Mon, Jul 22, 2013 at 02:14:28PM +0200, Gerhard Sittig wrote: + ret = clk_prepare_enable(clk); + if (ret) { + devm_clk_put(dev, clk); + goto free_irq; The main point of

[PATCH v3 01/31] spi: mpc512x: cleanup clock API use

2013-07-22 Thread Gerhard Sittig
cleanup the MPC512x SoC's SPI master's use of the clock API - get, prepare, and enable the MCLK during probe; disable, unprepare and put the MCLK upon remove; hold a reference to the clock over the period of use - fetch MCLK rate (reference) once during probe and slightly reword BCLK

Re: [PATCH v3 01/31] spi: mpc512x: cleanup clock API use

2013-07-22 Thread Mark Brown
On Mon, Jul 22, 2013 at 02:14:28PM +0200, Gerhard Sittig wrote: + ret = clk_prepare_enable(clk); + if (ret) { + devm_clk_put(dev, clk); + goto free_irq; The main point of the devm_ APIs is to avoid the need for explicit freeing so you should just remove these