]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
clk: Modify xlate() method for livetree
authorSimon Glass <sjg@chromium.org>
Fri, 19 May 2017 02:09:40 +0000 (20:09 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 1 Jun 2017 13:03:14 +0000 (07:03 -0600)
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>
drivers/clk/at91/pmc.c
drivers/clk/at91/pmc.h
drivers/clk/clk-uclass.c
drivers/clk/clk_stm32f7.c
include/clk-uclass.h

index f4ec5fcb5ec03f13037632f7a497bedbe0cba92e..be1d11ed4e0f3cc46beb1a2c8642fd83ef3ff1ef 100644 (file)
@@ -87,7 +87,7 @@ int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name)
        return 0;
 }
 
-int at91_clk_of_xlate(struct clk *clk, struct fdtdec_phandle_args *args)
+int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args)
 {
        int periph;
 
index f222fce11f427aef09625993994c97fe0f44a89b..bd3caba48d1d9bc0b92bb55e286f1daf771e1919 100644 (file)
@@ -15,7 +15,7 @@ struct pmc_platdata {
 int at91_pmc_core_probe(struct udevice *dev);
 int at91_clk_sub_device_bind(struct udevice *dev, const char *drv_name);
 
-int at91_clk_of_xlate(struct clk *clk, struct fdtdec_phandle_args *args);
+int at91_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args);
 int at91_clk_probe(struct udevice *dev);
 
 #endif
index 6fcfd6997c88d32a312b7ec2fb0b919a870b874b..f6194b60f98ab454321a232d044f9befedc3b313 100644 (file)
@@ -38,7 +38,7 @@ int clk_get_by_index_platdata(struct udevice *dev, int index,
 }
 # else
 static int clk_of_xlate_default(struct clk *clk,
-                               struct fdtdec_phandle_args *args)
+                               struct ofnode_phandle_args *args)
 {
        debug("%s(clk=%p)\n", __func__, clk);
 
@@ -86,9 +86,10 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk)
        ops = clk_dev_ops(dev_clk);
 
        if (ops->of_xlate)
-               ret = ops->of_xlate(clk, &args);
+               ret = ops->of_xlate(clk, (struct ofnode_phandle_args *)&args);
        else
-               ret = clk_of_xlate_default(clk, &args);
+               ret = clk_of_xlate_default(clk,
+                                          (struct ofnode_phandle_args *)&args);
        if (ret) {
                debug("of_xlate() failed: %d\n", ret);
                return ret;
index da3c204ff50310983418548c55785c258b46f7fb..fcdc3c052bd80b29e3846b89197b65170c4ed916 100644 (file)
@@ -252,8 +252,7 @@ static int stm32_clk_probe(struct udevice *dev)
        return 0;
 }
 
-static int stm32_clk_of_xlate(struct clk *clk,
-                       struct fdtdec_phandle_args *args)
+static int stm32_clk_of_xlate(struct clk *clk, struct ofnode_phandle_args *args)
 {
        debug("%s(clk=%p)\n", __func__, clk);
 
index 07c10654955cb7bdb75f4d2a923a4c1b5cdf3ff0..e7ea334c608b4f088af50524f80640bfd500d667 100644 (file)
@@ -12,7 +12,8 @@
 /* See clk.h for background documentation. */
 
 #include <clk.h>
-#include <fdtdec.h>
+
+struct ofnode_phandle_args;
 
 /**
  * struct clk_ops - The functions that a clock driver must implement.
@@ -37,7 +38,7 @@ struct clk_ops {
         * @return 0 if OK, or a negative error code.
         */
        int (*of_xlate)(struct clk *clock,
-                       struct fdtdec_phandle_args *args);
+                       struct ofnode_phandle_args *args);
        /**
         * request - Request a translated clock.
         *