Message ID | 20190622022254.GA7789@wens.csie.org (mailing list archive) |
---|---|
State | Mainlined |
Headers | show |
Series | [GIT,PULL] clk: sunxi-ng: clk parent rewrite part 1 - take 2 | expand |
Quoting Chen-Yu Tsai (2019-06-21 19:22:54) > Hi, > > Take 2 has build errors in drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c > fixed. > > The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9: > > Linux 5.2-rc1 (2019-05-19 15:47:09 -0700) > > are available in the Git repository at: > > https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi-ng-parent-rewrite-part-1-take-2 > > for you to fetch changes up to 89f27fb2dd348d8d52a97e6ebec15c64fe461a25: > > clk: sunxi-ng: sun8i-r: Use local parent references for SUNXI_CCU_GATE (2019-06-22 10:13:16 +0800) > > ---------------------------------------------------------------- Thanks. Pulled into clk-next. I applied this patch on top though to clean up the debugfs patch. A newline was missing. Does it make sense? I haven't tested it at all. diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 093161ca4dcc..09d8e84a1968 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2997,11 +2997,10 @@ static int clk_flags_show(struct seq_file *s, void *data) } DEFINE_SHOW_ATTRIBUTE(clk_flags); -static int possible_parents_show(struct seq_file *s, void *data) +static void possible_parent_show(struct seq_file *s, struct clk_core *core, + unsigned int i, char terminator) { - struct clk_core *core = s->private; struct clk_core *parent; - int i; /* * Go through the following options to fetch a parent's name. @@ -3015,22 +3014,6 @@ static int possible_parents_show(struct seq_file *s, void *data) * specified directly via a struct clk_hw pointer, but it isn't * registered (yet). */ - for (i = 0; i < core->num_parents - 1; i++) { - parent = clk_core_get_parent_by_index(core, i); - if (parent) - seq_printf(s, "%s ", parent->name); - else if (core->parents[i].name) - seq_printf(s, "%s ", core->parents[i].name); - else if (core->parents[i].fw_name) - seq_printf(s, "<%s>(fw) ", core->parents[i].fw_name); - else if (core->parents[i].index >= 0) - seq_printf(s, "%s ", - of_clk_get_parent_name(core->of_node, - core->parents[i].index)); - else - seq_puts(s, "(missing) "); - } - parent = clk_core_get_parent_by_index(core, i); if (parent) seq_printf(s, "%s", parent->name); @@ -3045,6 +3028,19 @@ static int possible_parents_show(struct seq_file *s, void *data) else seq_puts(s, "(missing)"); + seq_putc(s, terminator); +} + +static int possible_parents_show(struct seq_file *s, void *data) +{ + struct clk_core *core = s->private; + int i; + + for (i = 0; i < core->num_parents - 1; i++) + possible_parent_show(s, core, i, ' '); + + possible_parent_show(s, core, i, '\n'); + return 0; } DEFINE_SHOW_ATTRIBUTE(possible_parents);
On Tue, Jun 25, 2019 at 11:01 AM Stephen Boyd <sboyd@kernel.org> wrote: > > Quoting Chen-Yu Tsai (2019-06-21 19:22:54) > > Hi, > > > > Take 2 has build errors in drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c > > fixed. > > > > The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9: > > > > Linux 5.2-rc1 (2019-05-19 15:47:09 -0700) > > > > are available in the Git repository at: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi-ng-parent-rewrite-part-1-take-2 > > > > for you to fetch changes up to 89f27fb2dd348d8d52a97e6ebec15c64fe461a25: > > > > clk: sunxi-ng: sun8i-r: Use local parent references for SUNXI_CCU_GATE (2019-06-22 10:13:16 +0800) > > > > ---------------------------------------------------------------- > > Thanks. Pulled into clk-next. I applied this patch on top though to > clean up the debugfs patch. A newline was missing. Does it make sense? I > haven't tested it at all. Looks good to me. Thanks for the cleanup. Tested-by: Chen-Yu Tsai <wens@csie.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c > index 093161ca4dcc..09d8e84a1968 100644 > --- a/drivers/clk/clk.c > +++ b/drivers/clk/clk.c > @@ -2997,11 +2997,10 @@ static int clk_flags_show(struct seq_file *s, void *data) > } > DEFINE_SHOW_ATTRIBUTE(clk_flags); > > -static int possible_parents_show(struct seq_file *s, void *data) > +static void possible_parent_show(struct seq_file *s, struct clk_core *core, > + unsigned int i, char terminator) > { > - struct clk_core *core = s->private; > struct clk_core *parent; > - int i; > > /* > * Go through the following options to fetch a parent's name. > @@ -3015,22 +3014,6 @@ static int possible_parents_show(struct seq_file *s, void *data) > * specified directly via a struct clk_hw pointer, but it isn't > * registered (yet). > */ > - for (i = 0; i < core->num_parents - 1; i++) { > - parent = clk_core_get_parent_by_index(core, i); > - if (parent) > - seq_printf(s, "%s ", parent->name); > - else if (core->parents[i].name) > - seq_printf(s, "%s ", core->parents[i].name); > - else if (core->parents[i].fw_name) > - seq_printf(s, "<%s>(fw) ", core->parents[i].fw_name); > - else if (core->parents[i].index >= 0) > - seq_printf(s, "%s ", > - of_clk_get_parent_name(core->of_node, > - core->parents[i].index)); > - else > - seq_puts(s, "(missing) "); > - } > - > parent = clk_core_get_parent_by_index(core, i); > if (parent) > seq_printf(s, "%s", parent->name); > @@ -3045,6 +3028,19 @@ static int possible_parents_show(struct seq_file *s, void *data) > else > seq_puts(s, "(missing)"); > > + seq_putc(s, terminator); > +} > + > +static int possible_parents_show(struct seq_file *s, void *data) > +{ > + struct clk_core *core = s->private; > + int i; > + > + for (i = 0; i < core->num_parents - 1; i++) > + possible_parent_show(s, core, i, ' '); > + > + possible_parent_show(s, core, i, '\n'); > + > return 0; > } > DEFINE_SHOW_ATTRIBUTE(possible_parents); >