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: Optionally parse IO address from parent clock node

If no reg property is specified for a TI clock, let's try to use the
parent clock node IO address. This way we can avoid duplicate devicetree
reg properties that cause warnings for unique_unit_address.

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

authored by

Tony Lindgren and committed by
Stephen Boyd
274d6798 80864594

+8 -2
+8 -2
drivers/clk/ti/clk.c
··· 274 274 for (i = 0; i < CLK_MAX_MEMMAPS; i++) { 275 275 if (clocks_node_ptr[i] == node->parent) 276 276 break; 277 + if (clocks_node_ptr[i] == node->parent->parent) 278 + break; 277 279 } 278 280 279 281 if (i == CLK_MAX_MEMMAPS) { ··· 286 284 reg->index = i; 287 285 288 286 if (of_property_read_u32_index(node, "reg", index, &val)) { 289 - pr_err("%pOFn must have reg[%d]!\n", node, index); 290 - return -EINVAL; 287 + if (of_property_read_u32_index(node->parent, "reg", 288 + index, &val)) { 289 + pr_err("%pOFn or parent must have reg[%d]!\n", 290 + node, index); 291 + return -EINVAL; 292 + } 291 293 } 292 294 293 295 reg->offset = val;