[PATCH v2 1/5] clk: remove duplicated code with __clk_set_parent_after

Dong Aisheng b29396 at freescale.com
Thu May 28 01:25:01 PDT 2015


On Wed, May 27, 2015 at 09:09:19PM -0700, Michael Turquette wrote:
> Quoting Dong Aisheng (2015-05-14 06:28:59)
> > __clk_set_parent_after() actually used the second argument then we
> > could put this duplicate logic in there and call it with a different
> > order of arguments in the success vs. error paths in this function.
> > 
> > Cc: Mike Turquette <mturquette at linaro.org>
> > Cc: Stephen Boyd <sboyd at codeaurora.org>
> > Suggested-by: Stephen Boyd <sboyd at codeaurora.org>
> > Signed-off-by: Dong Aisheng <aisheng.dong at freescale.com>
> 
> Patch looks good to me.
> 

Thanks for the review.

> Also just noticed that the second argument to __clk_set_parent_after is
> never used :-(
> 

Yes, before this patch series, it's never used. :)

Regards
Dong Aisheng

> Regards,
> Mike
> 
> > ---
> >  drivers/clk/clk.c | 8 +-------
> >  1 file changed, 1 insertion(+), 7 deletions(-)
> > 
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index 659f2b0..0e813ea 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -1159,14 +1159,8 @@ static int __clk_set_parent(struct clk_core *core, struct clk_core *parent,
> >                 flags = clk_enable_lock();
> >                 clk_reparent(core, old_parent);
> >                 clk_enable_unlock(flags);
> > +               __clk_set_parent_after(core, old_parent, parent);
> >  
> > -               if (core->prepare_count) {
> > -                       flags = clk_enable_lock();
> > -                       clk_core_disable(core);
> > -                       clk_core_disable(parent);
> > -                       clk_enable_unlock(flags);
> > -                       clk_core_unprepare(parent);
> > -               }
> >                 return ret;
> >         }
> >  
> > -- 
> > 1.9.1
> > 



More information about the linux-arm-kernel mailing list