Merge tag 'u-boot-imx-20200825' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
[platform/kernel/u-boot.git] / drivers / clk / clk-fixed-factor.c
index 711b058..8d9823b 100644 (file)
@@ -9,17 +9,18 @@
 #include <malloc.h>
 #include <clk-uclass.h>
 #include <dm/device.h>
+#include <dm/devres.h>
 #include <linux/clk-provider.h>
 #include <div64.h>
 #include <clk.h>
 #include "clk.h"
+#include <linux/err.h>
 
 #define UBOOT_DM_CLK_IMX_FIXED_FACTOR "ccf_clk_fixed_factor"
 
 static ulong clk_factor_recalc_rate(struct clk *clk)
 {
-       struct clk_fixed_factor *fix =
-               to_clk_fixed_factor(dev_get_clk_ptr(clk->dev));
+       struct clk_fixed_factor *fix = to_clk_fixed_factor(clk);
        unsigned long parent_rate = clk_get_parent_rate(clk);
        unsigned long long int rate;
 
@@ -48,6 +49,7 @@ struct clk *clk_hw_register_fixed_factor(struct device *dev,
        fix->mult = mult;
        fix->div = div;
        clk = &fix->clk;
+       clk->flags = flags;
 
        ret = clk_register(clk, UBOOT_DM_CLK_IMX_FIXED_FACTOR, name,
                           parent_name);