2008/3/31, Pavel Machek <pavel@ucw.cz>:
quoted text >
> > +int __must_check clk_register(struct clk *clk);
> > +void clk_unregister(struct clk *clk);
> > +static void __maybe_unused clks_unregister(struct clk **clks, size_t num)
> > +{
> > + int i;
> > + for (i = num - 1; i >= 0; i++) {
> > + clk_unregister(clks[i]);
> > + }
> > +}
> > +
> > +static int __must_check __maybe_unused clks_register(struct clk **clks, size_t num)
> > +{
> > + int i;
> > + int ret;
> > + for (i = 0; i < num; i++) {
> > + ret = clk_register(clks[i]);
> > + if (ret != 0)
> > + goto cleanup;
> > + }
> > +
> > + return 0;
> > +
> > +cleanup:
> > + clks_unregister(clks, i);
> > +
> > + for (i -- ; i >= 0; i--) {
>
>
> "for (i--;"
ack
quoted text >
> > + clk_unregister(clks[i]);
> > + }
> > +
> > + return ret;
>
>
> Hmm, clk_unregister is _very_ similar to clks_unregister....
oops :)
--
With best wishes
Dmitry
--
unsubscribe notice To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Messages in current thread:
Re: [PATCH 1/6] Clocklib: add generic framework for managing... , Dmitry , (Mon Mar 31, 12:18 pm)