Commit a4e0ef50dae404939f14e46493a3d5c2111a9d4c
1 parent
a1e4adee99
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
clk: Modify xlate() method for livetree
Update the xlate() method to use ofnode_phandle_args instead of the fdtdec variant. This will allow drivers to support a live device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
Showing 5 changed files with 10 additions and 9 deletions Side-by-side Diff
drivers/clk/at91/pmc.c
drivers/clk/at91/pmc.h
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | int at91_pmc_core_probe(struct udevice *dev); |
16 | 16 | int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name); |
17 | 17 | |
18 | -int at91_clk_of_xlate(struct clk *clk, struct fdtdec_phandle_args *args); | |
18 | +int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args); | |
19 | 19 | int at91_clk_probe(struct udevice *dev); |
20 | 20 | |
21 | 21 | #endif |
drivers/clk/clk-uclass.c
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | } |
39 | 39 | # else |
40 | 40 | static int clk_of_xlate_default(struct clk *clk, |
41 | - struct fdtdec_phandle_args *args) | |
41 | + struct ofnode_phandle_args *args) | |
42 | 42 | { |
43 | 43 | debug("%s(clk=%p)\n", __func__, clk); |
44 | 44 | |
45 | 45 | |
... | ... | @@ -86,9 +86,10 @@ |
86 | 86 | ops = clk_dev_ops(dev_clk); |
87 | 87 | |
88 | 88 | if (ops->of_xlate) |
89 | - ret = ops->of_xlate(clk, &args); | |
89 | + ret = ops->of_xlate(clk, (struct ofnode_phandle_args *)&args); | |
90 | 90 | else |
91 | - ret = clk_of_xlate_default(clk, &args); | |
91 | + ret = clk_of_xlate_default(clk, | |
92 | + (struct ofnode_phandle_args *)&args); | |
92 | 93 | if (ret) { |
93 | 94 | debug("of_xlate() failed: %d\n", ret); |
94 | 95 | return ret; |
drivers/clk/clk_stm32f7.c
... | ... | @@ -252,8 +252,7 @@ |
252 | 252 | return 0; |
253 | 253 | } |
254 | 254 | |
255 | -static int stm32_clk_of_xlate(struct clk *clk, | |
256 | - struct fdtdec_phandle_args *args) | |
255 | +static int stm32_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args) | |
257 | 256 | { |
258 | 257 | debug("%s(clk=%p)\n", __func__, clk); |
259 | 258 |
include/clk-uclass.h
... | ... | @@ -12,8 +12,9 @@ |
12 | 12 | /* See clk.h for background documentation. */ |
13 | 13 | |
14 | 14 | #include <clk.h> |
15 | -#include <fdtdec.h> | |
16 | 15 | |
16 | +struct ofnode_phandle_args; | |
17 | + | |
17 | 18 | /** |
18 | 19 | * struct clk_ops - The functions that a clock driver must implement. |
19 | 20 | */ |
... | ... | @@ -37,7 +38,7 @@ |
37 | 38 | * @return 0 if OK, or a negative error code. |
38 | 39 | */ |
39 | 40 | int (*of_xlate)(struct clk *clock, |
40 | - struct fdtdec_phandle_args *args); | |
41 | + struct ofnode_phandle_args *args); | |
41 | 42 | /** |
42 | 43 | * request - Request a translated clock. |
43 | 44 | * |