Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1468449

Re: [PATCH v2 2/5] clk: sunxi-ng: mux: support fixed pre-dividers on multiple parents

From Maxime Ripard <maxime.ripard@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/5] clk: sunxi-ng: mux: support fixed pre-dividers on multiple parents
Date 2016-08-23 12:00 +0200
Message-ID <s9gEW-2aI-9@gated-at.bofh.it> (permalink)
References <s6m49-3Ev-11@gated-at.bofh.it> <s6mdP-3HY-23@gated-at.bofh.it> <s9fSy-1R4-115@gated-at.bofh.it> <s9gEW-2aI-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, Aug 23, 2016 at 05:52:59PM +0800, Chen-Yu Tsai wrote:
> >>  static const char * const ahb2_parents[] = { "ahb1" , "pll-periph0" };
> >> +static const struct ccu_mux_fixed_prediv ahb2_fixed_predivs[] = {
> >> +     { .index = 1, .div = 2 },
> >> +     { },
> >> +};
> >>
> >> [...]
> >>
> >> --- a/drivers/clk/sunxi-ng/ccu_mux.h
> >> +++ b/drivers/clk/sunxi-ng/ccu_mux.h
> >> @@ -5,15 +5,18 @@
> >>
> >>  #include "ccu_common.h"
> >>
> >> +struct ccu_mux_fixed_prediv {
> >> +     u8      index;
> >> +     u16     div;
> >> +};
> >> +
> >>  struct ccu_mux_internal {
> >>       u8              shift;
> >>       u8              width;
> >>       const u8        *table;
> >>
> >> -     struct {
> >> -             u8      index;
> >> -             u16     div;
> >> -     } fixed_prediv;
> >> +     const struct ccu_mux_fixed_prediv       *fixed_predivs;
> >> +     u8              n_predivs;
> >
> > I don't think you're using it anywhere (at least you don't define it
> > in ahb2_clk, and the extra item in the array will introduce an
> > off-by-one error.
> 
> The truth is I forgot to update the change in ccu-sun8i-h3.c
> It is used correctly in the subsequent a31 patch. Sorry.
> 
> I'm not sure what you mean by the off-by-one error though. IIRC
> we initialize the structure using named fields.

What I meant was that remember to also remove the second empty field
in ahb2_fixed_predivs.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] clk: sunxi-ng: Support A31/A31s CCU Chen-Yu Tsai <wens@csie.org> - 2016-08-15 11:10 +0200
  [PATCH v2 5/5] ARM: dts: sun6i: switch A31/A31s to new CCU clock bindings Chen-Yu Tsai <wens@csie.org> - 2016-08-15 11:10 +0200
  [PATCH v2 2/5] clk: sunxi-ng: mux: support fixed pre-dividers on multiple parents Chen-Yu Tsai <wens@csie.org> - 2016-08-15 11:20 +0200
    Re: [PATCH v2 2/5] clk: sunxi-ng: mux: support fixed pre-dividers on  multiple parents Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-08-23 11:10 +0200
      Re: [PATCH v2 2/5] clk: sunxi-ng: mux: support fixed pre-dividers on  multiple parents Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-08-23 12:00 +0200
      Re: [PATCH v2 2/5] clk: sunxi-ng: mux: support fixed pre-dividers on  multiple parents Chen-Yu Tsai <wens@csie.org> - 2016-08-23 12:20 +0200
  [PATCH v2 3/5] clk: sunxi-ng: mux: Add clk notifier functions Chen-Yu Tsai <wens@csie.org> - 2016-08-15 11:20 +0200
  Re: [PATCH v2 4/5] clk: sunxi-ng: Add A31/A31s clocks Jean-Francois Moine <moinejf@free.fr> - 2016-08-15 20:20 +0200

csiph-web