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: Add ti_dt_clk_name() helper to use clock-output-names

Let's create the clock alias based on the clock-output-names property if
available. Also the component clock drivers can use ti_dt_clk_name() in
the following patches.

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

authored by

Tony Lindgren and committed by
Stephen Boyd
2c159332 d02747e9

+20 -1
+19 -1
drivers/clk/ti/clk.c
··· 448 448 }; 449 449 450 450 /** 451 + * ti_dt_clk_name - init clock name from first output name or node name 452 + * @np: device node 453 + * 454 + * Use the first clock-output-name for the clock name if found. Fall back 455 + * to legacy naming based on node name. 456 + */ 457 + const char *ti_dt_clk_name(struct device_node *np) 458 + { 459 + const char *name; 460 + 461 + if (!of_property_read_string_index(np, "clock-output-names", 0, 462 + &name)) 463 + return name; 464 + 465 + return np->name; 466 + } 467 + 468 + /** 451 469 * ti_clk_add_aliases - setup clock aliases 452 470 * 453 471 * Sets up any missing clock aliases. No return value. ··· 481 463 clkspec.np = np; 482 464 clk = of_clk_get_from_provider(&clkspec); 483 465 484 - ti_clk_add_alias(NULL, clk, np->name); 466 + ti_clk_add_alias(NULL, clk, ti_dt_clk_name(np)); 485 467 } 486 468 } 487 469
+1
drivers/clk/ti/clock.h
··· 214 214 const char *con); 215 215 struct clk *ti_clk_register_omap_hw(struct device *dev, struct clk_hw *hw, 216 216 const char *con); 217 + const char *ti_dt_clk_name(struct device_node *np); 217 218 int ti_clk_add_alias(struct device *dev, struct clk *clk, const char *con); 218 219 void ti_clk_add_aliases(void); 219 220