Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: ti: Use clock-output-names for clkctrl

Use clock-output-names devicetree property for clkctrl clocks if
available.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20220204071449.16762-6-tony@atomide.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Tony Lindgren and committed by
Stephen Boyd
d02747e9 51f661ef

+20 -2
+20 -2
drivers/clk/ti/clkctrl.c
··· 469 469 of_clk_add_hw_provider(np, _ti_omap4_clkctrl_xlate, data); 470 470 } 471 471 472 - /* Get clock name based on compatible string for clkctrl */ 473 - static char * __init clkctrl_get_name(struct device_node *np) 472 + /* 473 + * Get clock name based on "clock-output-names" property or the 474 + * compatible property for clkctrl. 475 + */ 476 + static const char * __init clkctrl_get_name(struct device_node *np) 474 477 { 475 478 struct property *prop; 476 479 const int prefix_len = 11; 477 480 const char *compat; 481 + const char *output; 478 482 char *name; 483 + 484 + if (!of_property_read_string_index(np, "clock-output-names", 0, 485 + &output)) { 486 + const char *end; 487 + int len; 488 + 489 + len = strlen(output); 490 + end = strstr(output, "_clkctrl"); 491 + if (end) 492 + len -= strlen(end); 493 + name = kstrndup(output, len, GFP_KERNEL); 494 + 495 + return name; 496 + } 479 497 480 498 of_property_for_each_string(np, "compatible", prop, compat) { 481 499 if (!strncmp("ti,clkctrl-", compat, prefix_len)) {