Skip to content

Commit 5cf9d01

Browse files
nathanchancebebarino
authored andcommitted
clk: Avoid invalid function names in CLK_OF_DECLARE()
After commit c28cd1f ("clk: Mark a fwnode as initialized when using CLK_OF_DECLARE() macro"), drivers/clk/mvebu/kirkwood.c fails to build: drivers/clk/mvebu/kirkwood.c:358:1: error: expected identifier or '(' CLK_OF_DECLARE(98dx1135_clk, "marvell,mv98dx1135-core-clock", ^ include/linux/clk-provider.h:1367:21: note: expanded from macro 'CLK_OF_DECLARE' static void __init name##_of_clk_init_declare(struct device_node *np) \ ^ <scratch space>:124:1: note: expanded from here 98dx1135_clk_of_clk_init_declare ^ drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE' OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare) ^ <scratch space>:125:3: note: expanded from here 98dx1135_clk_of_clk_init_declare ^ drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE' OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare) ^ <scratch space>:125:3: note: expanded from here 98dx1135_clk_of_clk_init_declare ^ drivers/clk/mvebu/kirkwood.c:358:1: error: invalid digit 'd' in decimal constant include/linux/clk-provider.h:1372:34: note: expanded from macro 'CLK_OF_DECLARE' OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare) ^ <scratch space>:125:3: note: expanded from here 98dx1135_clk_of_clk_init_declare ^ C function names must start with either an alphabetic letter or an underscore. To avoid generating invalid function names from clock names, add two underscores to the beginning of the identifier. Fixes: c28cd1f ("clk: Mark a fwnode as initialized when using CLK_OF_DECLARE() macro") Suggested-by: Saravana Kannan <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Saravana Kannan <[email protected]> Reported-by: Naresh Kamboju <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 89dc65a commit 5cf9d01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/clk-provider.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,12 +1364,12 @@ struct clk_hw_onecell_data {
13641364
};
13651365

13661366
#define CLK_OF_DECLARE(name, compat, fn) \
1367-
static void __init name##_of_clk_init_declare(struct device_node *np) \
1367+
static void __init __##name##_of_clk_init_declare(struct device_node *np) \
13681368
{ \
13691369
fn(np); \
13701370
fwnode_dev_initialized(of_fwnode_handle(np), true); \
13711371
} \
1372-
OF_DECLARE_1(clk, name, compat, name##_of_clk_init_declare)
1372+
OF_DECLARE_1(clk, name, compat, __##name##_of_clk_init_declare)
13731373

13741374
/*
13751375
* Use this macro when you have a driver that requires two initialization

0 commit comments

Comments
 (0)