Re: [PATCH] clk: Free struct clk allocated during clk_hw_register()

2016-11-08 Thread Rajendra Nayak
On 11/08/2016 03:34 PM, Rajendra Nayak wrote: > > > On 11/08/2016 03:06 PM, Geert Uytterhoeven wrote: >> Hi Rajendra, >> >> On Tue, Nov 8, 2016 at 9:23 AM, Rajendra Nayak wrote: >>> With clk_hw_register() API we hide the struct clk from the caller >>> and return an int error code instead, so th

Re: [PATCH] clk: Free struct clk allocated during clk_hw_register()

2016-11-08 Thread Rajendra Nayak
On 11/08/2016 03:06 PM, Geert Uytterhoeven wrote: > Hi Rajendra, > > On Tue, Nov 8, 2016 at 9:23 AM, Rajendra Nayak wrote: >> With clk_hw_register() API we hide the struct clk from the caller >> and return an int error code instead, so the caller (clk provider) >> is not expected to use hw->clk

Re: [PATCH] clk: Free struct clk allocated during clk_hw_register()

2016-11-08 Thread Geert Uytterhoeven
Hi Rajendra, On Tue, Nov 8, 2016 at 9:23 AM, Rajendra Nayak wrote: > With clk_hw_register() API we hide the struct clk from the caller > and return an int error code instead, so the caller (clk provider) > is not expected to use hw->clk on return. That's correct, in case of failure. > Free the

[PATCH] clk: Free struct clk allocated during clk_hw_register()

2016-11-08 Thread Rajendra Nayak
With clk_hw_register() API we hide the struct clk from the caller and return an int error code instead, so the caller (clk provider) is not expected to use hw->clk on return. Free the memory, and mark hw->clk as NULL before returning. Signed-off-by: Rajendra Nayak --- drivers/clk/clk.c | 10