aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 75d13c0eff12..d2477a5058ac 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1513,9 +1513,19 @@ static int clk_fetch_parent_index(struct clk_core *core,
1513 if (!parent) 1513 if (!parent)
1514 return -EINVAL; 1514 return -EINVAL;
1515 1515
1516 for (i = 0; i < core->num_parents; i++) 1516 for (i = 0; i < core->num_parents; i++) {
1517 if (clk_core_get_parent_by_index(core, i) == parent) 1517 if (core->parents[i] == parent)
1518 return i;
1519
1520 if (core->parents[i])
1521 continue;
1522
1523 /* Fallback to comparing globally unique names */
1524 if (!strcmp(parent->name, core->parent_names[i])) {
1525 core->parents[i] = parent;
1518 return i; 1526 return i;
1527 }
1528 }
1519 1529
1520 return -EINVAL; 1530 return -EINVAL;
1521} 1531}
@@ -2779,7 +2789,7 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level)
2779 seq_printf(s, "\"protect_count\": %d,", c->protect_count); 2789 seq_printf(s, "\"protect_count\": %d,", c->protect_count);
2780 seq_printf(s, "\"rate\": %lu,", clk_core_get_rate(c)); 2790 seq_printf(s, "\"rate\": %lu,", clk_core_get_rate(c));
2781 seq_printf(s, "\"accuracy\": %lu,", clk_core_get_accuracy(c)); 2791 seq_printf(s, "\"accuracy\": %lu,", clk_core_get_accuracy(c));
2782 seq_printf(s, "\"phase\": %d", clk_core_get_phase(c)); 2792 seq_printf(s, "\"phase\": %d,", clk_core_get_phase(c));
2783 seq_printf(s, "\"duty_cycle\": %u", 2793 seq_printf(s, "\"duty_cycle\": %u",
2784 clk_core_get_scaled_duty_cycle(c, 100000)); 2794 clk_core_get_scaled_duty_cycle(c, 100000));
2785} 2795}