Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-15 Thread Stephen Boyd
On 04/14, Masahiro Yamada wrote: > > OK, now I notice another problem in my code; > if foo_clk_init() fails for reason [2], > clk_disable() WARN's due to zero enable_count. > > if (WARN_ON(core->enable_count == 0)) > return; > > > > Perhaps, I got screwed up by splitting clock init st

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-13 Thread Masahiro Yamada
Hi Stephen, 2016-04-14 9:33 GMT+09:00 Stephen Boyd : > On 04/08, Masahiro Yamada wrote: >> >> >> This makes our driver programming life easier. >> >> >> For example, let's see drivers/tty/serial/8250/8250_of.c >> >> >> The "clock-frequency" DT property takes precedence over "clocks" property. >>

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-13 Thread Stephen Boyd
On 04/08, Ralf Baechle wrote: > > While your argument makes perfect sense, Many clk_disable implementations > are already doing similar checks, for example: > > arch/arm/mach-davinci/clock.c: > [...] > > So should we go and weed out these checks? Yes, it would be nice to at least make the diff

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-13 Thread Stephen Boyd
On 04/08, Masahiro Yamada wrote: > > > This makes our driver programming life easier. > > > For example, let's see drivers/tty/serial/8250/8250_of.c > > > The "clock-frequency" DT property takes precedence over "clocks" property. > So, it is valid to probe the driver with a NULL pointer for i

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-08 Thread Masahiro Yamada
2016-04-08 19:06 GMT+09:00 Ralf Baechle : > On Thu, Apr 07, 2016 at 05:33:28PM -0700, Stephen Boyd wrote: > >> On 04/05, Masahiro Yamada wrote: >> > The clk_disable() in the common clock framework (drivers/clk/clk.c) >> > returns immediately if a given clk is NULL or an error pointer. It >> > allo

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-08 Thread Ralf Baechle
On Thu, Apr 07, 2016 at 05:33:28PM -0700, Stephen Boyd wrote: > On 04/05, Masahiro Yamada wrote: > > The clk_disable() in the common clock framework (drivers/clk/clk.c) > > returns immediately if a given clk is NULL or an error pointer. It > > allows clock consumers to call clk_disable() without

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-07 Thread Masahiro Yamada
Hi Stephen, 2016-04-08 9:33 GMT+09:00 Stephen Boyd : > On 04/05, Masahiro Yamada wrote: >> The clk_disable() in the common clock framework (drivers/clk/clk.c) >> returns immediately if a given clk is NULL or an error pointer. It >> allows clock consumers to call clk_disable() without IS_ERR_OR_N

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-07 Thread Stephen Boyd
On 04/05, Masahiro Yamada wrote: > The clk_disable() in the common clock framework (drivers/clk/clk.c) > returns immediately if a given clk is NULL or an error pointer. It > allows clock consumers to call clk_disable() without IS_ERR_OR_NULL > checking if drivers are only used with the common cloc

[PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-04 Thread Masahiro Yamada
The clk_disable() in the common clock framework (drivers/clk/clk.c) returns immediately if a given clk is NULL or an error pointer. It allows clock consumers to call clk_disable() without IS_ERR_OR_NULL checking if drivers are only used with the common clock framework. Unfortunately, NULL/error c