aboutsummaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorTom Rini2020-02-11 10:58:41 -0500
committerTom Rini2020-02-11 10:58:41 -0500
commit9a8942b53d57149754e0dfc975e0d92d1afd4087 (patch)
treede55e5352f3a8a79c413c0b8cb533428e5476841 /drivers/clk
parentae347120eed8204b1fdf018ddf79131964e57016 (diff)
parent21d651fb29cf268b1a5f64d080e3d352ee32c87f (diff)
Merge tag 'dm-pull-6feb20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
sandbox conversion to SDL2 TPM TEE driver Various minor sandbox video enhancements New driver model core utility functions
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/altera/clk-arria10.c3
-rw-r--r--drivers/clk/aspeed/clk_ast2500.c1
-rw-r--r--drivers/clk/at91/clk-generated.c2
-rw-r--r--drivers/clk/at91/clk-h32mx.c1
-rw-r--r--drivers/clk/at91/clk-peripheral.c1
-rw-r--r--drivers/clk/at91/clk-usb.c1
-rw-r--r--drivers/clk/clk-cdce9xx.c1
-rw-r--r--drivers/clk/clk-composite.c2
-rw-r--r--drivers/clk/clk-divider.c2
-rw-r--r--drivers/clk/clk-fixed-factor.c2
-rw-r--r--drivers/clk/clk-gate.c2
-rw-r--r--drivers/clk/clk-mux.c2
-rw-r--r--drivers/clk/clk-ti-sci.c5
-rw-r--r--drivers/clk/clk-uclass.c9
-rw-r--r--drivers/clk/clk_fixed_factor.c1
-rw-r--r--drivers/clk/clk_sandbox.c3
-rw-r--r--drivers/clk/clk_sandbox_ccf.c3
-rw-r--r--drivers/clk/clk_sandbox_test.c3
-rw-r--r--drivers/clk/clk_versal.c2
-rw-r--r--drivers/clk/clk_vexpress_osc.c1
-rw-r--r--drivers/clk/clk_zynq.c1
-rw-r--r--drivers/clk/clk_zynqmp.c3
-rw-r--r--drivers/clk/imx/clk-composite-8m.c2
-rw-r--r--drivers/clk/imx/clk-gate2.c2
-rw-r--r--drivers/clk/imx/clk-imx8.c1
-rw-r--r--drivers/clk/imx/clk-pfd.c2
-rw-r--r--drivers/clk/imx/clk-pll14xx.c2
-rw-r--r--drivers/clk/imx/clk-pllv3.c2
-rw-r--r--drivers/clk/meson/axg.c1
-rw-r--r--drivers/clk/meson/g12a.c1
-rw-r--r--drivers/clk/meson/gxbb.c1
-rw-r--r--drivers/clk/mvebu/armada-37xx-periph.c1
-rw-r--r--drivers/clk/mvebu/armada-37xx-tbg.c1
-rw-r--r--drivers/clk/rockchip/clk_px30.c1
-rw-r--r--drivers/clk/rockchip/clk_rk3036.c1
-rw-r--r--drivers/clk/rockchip/clk_rk3128.c1
-rw-r--r--drivers/clk/rockchip/clk_rk3188.c2
-rw-r--r--drivers/clk/rockchip/clk_rk322x.c1
-rw-r--r--drivers/clk/rockchip/clk_rk3288.c2
-rw-r--r--drivers/clk/rockchip/clk_rk3308.c1
-rw-r--r--drivers/clk/rockchip/clk_rk3328.c1
-rw-r--r--drivers/clk/rockchip/clk_rk3368.c1
-rw-r--r--drivers/clk/rockchip/clk_rk3399.c1
-rw-r--r--drivers/clk/rockchip/clk_rv1108.c1
-rw-r--r--drivers/clk/sifive/fu540-prci.c1
-rw-r--r--drivers/clk/tegra/tegra-car-clk.c3
-rw-r--r--drivers/clk/uniphier/clk-uniphier-core.c1
47 files changed, 79 insertions, 6 deletions
diff --git a/drivers/clk/altera/clk-arria10.c b/drivers/clk/altera/clk-arria10.c
index 179869df45f..affeb31fc2e 100644
--- a/drivers/clk/altera/clk-arria10.c
+++ b/drivers/clk/altera/clk-arria10.c
@@ -4,9 +4,12 @@
*/
#include <common.h>
+#include <malloc.h>
#include <asm/io.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <dm/device_compat.h>
+#include <dm/devres.h>
#include <dm/lists.h>
#include <dm/util.h>
diff --git a/drivers/clk/aspeed/clk_ast2500.c b/drivers/clk/aspeed/clk_ast2500.c
index b3a3f3d4dd9..f4a441ad684 100644
--- a/drivers/clk/aspeed/clk_ast2500.c
+++ b/drivers/clk/aspeed/clk_ast2500.c
@@ -10,6 +10,7 @@
#include <asm/arch/scu_ast2500.h>
#include <dm/lists.h>
#include <dt-bindings/clock/ast2500-scu.h>
+#include <linux/err.h>
/*
* MAC Clock Delay settings, taken from Aspeed SDK
diff --git a/drivers/clk/at91/clk-generated.c b/drivers/clk/at91/clk-generated.c
index 70b277e26f7..a80f259a72c 100644
--- a/drivers/clk/at91/clk-generated.c
+++ b/drivers/clk/at91/clk-generated.c
@@ -7,6 +7,8 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <malloc.h>
+#include <linux/err.h>
#include <linux/io.h>
#include <mach/at91_pmc.h>
#include "pmc.h"
diff --git a/drivers/clk/at91/clk-h32mx.c b/drivers/clk/at91/clk-h32mx.c
index 8f02d73d8da..86bb71f6128 100644
--- a/drivers/clk/at91/clk-h32mx.c
+++ b/drivers/clk/at91/clk-h32mx.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <dm/device_compat.h>
#include <dm/util.h>
#include <linux/io.h>
#include <mach/at91_pmc.h>
diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
index c880af8155f..c55e6214b22 100644
--- a/drivers/clk/at91/clk-peripheral.c
+++ b/drivers/clk/at91/clk-peripheral.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <malloc.h>
#include <linux/io.h>
#include <mach/at91_pmc.h>
#include "pmc.h"
diff --git a/drivers/clk/at91/clk-usb.c b/drivers/clk/at91/clk-usb.c
index 24af183b550..c3cb2ba0146 100644
--- a/drivers/clk/at91/clk-usb.c
+++ b/drivers/clk/at91/clk-usb.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <linux/err.h>
#include <linux/io.h>
#include <mach/at91_pmc.h>
#include "pmc.h"
diff --git a/drivers/clk/clk-cdce9xx.c b/drivers/clk/clk-cdce9xx.c
index 5d1489ab0ec..f1f76b0a4da 100644
--- a/drivers/clk/clk-cdce9xx.c
+++ b/drivers/clk/clk-cdce9xx.c
@@ -13,6 +13,7 @@
#include <errno.h>
#include <clk-uclass.h>
#include <i2c.h>
+#include <dm/device_compat.h>
#define MAX_NUMBER_OF_PLLS 4
#define MAX_NUMER_OF_OUTPUTS 9
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index a5626c33d1e..414185031e2 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -9,8 +9,10 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <linux/clk-provider.h>
#include <clk.h>
+#include <linux/err.h>
#include "clk.h"
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index 822e09b0844..d79ae367b80 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -14,10 +14,12 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <dm/uclass.h>
#include <dm/lists.h>
#include <dm/device-internal.h>
#include <linux/clk-provider.h>
+#include <linux/err.h>
#include <linux/log2.h>
#include <div64.h>
#include <clk.h>
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 711b0588bc3..2ceb6bb171c 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -9,10 +9,12 @@
#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"
diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index 70b87945545..6415c2f1b91 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -12,9 +12,11 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <linux/clk-provider.h>
#include <clk.h>
#include "clk.h"
+#include <linux/err.h>
#define UBOOT_DM_CLK_GATE "clk_gate"
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 5acc0b8cbd0..b9d2ae6778f 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -26,9 +26,11 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <linux/clk-provider.h>
#include <clk.h>
#include "clk.h"
+#include <linux/err.h>
#define UBOOT_DM_CLK_CCF_MUX "ccf_clk_mux"
diff --git a/drivers/clk/clk-ti-sci.c b/drivers/clk/clk-ti-sci.c
index ed1facbbcd7..82241d9f3f5 100644
--- a/drivers/clk/clk-ti-sci.c
+++ b/drivers/clk/clk-ti-sci.c
@@ -12,6 +12,9 @@
#include <dm.h>
#include <errno.h>
#include <clk-uclass.h>
+#include <malloc.h>
+#include <dm/device_compat.h>
+#include <linux/err.h>
#include <linux/soc/ti/ti_sci_protocol.h>
#include <k3-avs.h>
@@ -203,7 +206,7 @@ static const struct udevice_id ti_sci_clk_of_match[] = {
static struct clk_ops ti_sci_clk_ops = {
.of_xlate = ti_sci_clk_of_xlate,
.request = ti_sci_clk_request,
- .free = ti_sci_clk_free,
+ .rfree = ti_sci_clk_free,
.get_rate = ti_sci_clk_get_rate,
.set_rate = ti_sci_clk_set_rate,
.set_parent = ti_sci_clk_set_parent,
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 0df38bd06a4..71878474ebe 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -10,10 +10,13 @@
#include <clk.h>
#include <clk-uclass.h>
#include <dm.h>
-#include <dm/read.h>
#include <dt-structs.h>
#include <errno.h>
+#include <malloc.h>
+#include <dm/devres.h>
+#include <dm/read.h>
#include <linux/clk-provider.h>
+#include <linux/err.h>
static inline const struct clk_ops *clk_dev_ops(struct udevice *dev)
{
@@ -423,10 +426,10 @@ int clk_free(struct clk *clk)
return 0;
ops = clk_dev_ops(clk->dev);
- if (!ops->free)
+ if (!ops->rfree)
return 0;
- return ops->free(clk);
+ return ops->rfree(clk);
}
ulong clk_get_rate(struct clk *clk)
diff --git a/drivers/clk/clk_fixed_factor.c b/drivers/clk/clk_fixed_factor.c
index dcdb6ddf5cf..cf9c4ae367f 100644
--- a/drivers/clk/clk_fixed_factor.c
+++ b/drivers/clk/clk_fixed_factor.c
@@ -9,6 +9,7 @@
#include <clk-uclass.h>
#include <div64.h>
#include <dm.h>
+#include <linux/err.h>
struct clk_fixed_factor {
struct clk parent;
diff --git a/drivers/clk/clk_sandbox.c b/drivers/clk/clk_sandbox.c
index de6b2f7c82f..768fbb7c520 100644
--- a/drivers/clk/clk_sandbox.c
+++ b/drivers/clk/clk_sandbox.c
@@ -7,6 +7,7 @@
#include <clk-uclass.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <asm/clk.h>
struct sandbox_clk_priv {
@@ -107,7 +108,7 @@ static struct clk_ops sandbox_clk_ops = {
.enable = sandbox_clk_enable,
.disable = sandbox_clk_disable,
.request = sandbox_clk_request,
- .free = sandbox_clk_free,
+ .rfree = sandbox_clk_free,
};
static int sandbox_clk_probe(struct udevice *dev)
diff --git a/drivers/clk/clk_sandbox_ccf.c b/drivers/clk/clk_sandbox_ccf.c
index 9fa27229e18..3543bea70d2 100644
--- a/drivers/clk/clk_sandbox_ccf.c
+++ b/drivers/clk/clk_sandbox_ccf.c
@@ -9,10 +9,13 @@
#include <common.h>
#include <dm.h>
#include <clk.h>
+#include <malloc.h>
#include <asm/clk.h>
#include <clk-uclass.h>
+#include <dm/devres.h>
#include <linux/clk-provider.h>
#include <sandbox-clk.h>
+#include <linux/err.h>
/*
* Sandbox implementation of CCF primitives necessary for clk-uclass testing
diff --git a/drivers/clk/clk_sandbox_test.c b/drivers/clk/clk_sandbox_test.c
index 41954660ea1..873383856f9 100644
--- a/drivers/clk/clk_sandbox_test.c
+++ b/drivers/clk/clk_sandbox_test.c
@@ -6,7 +6,10 @@
#include <common.h>
#include <dm.h>
#include <clk.h>
+#include <malloc.h>
#include <asm/clk.h>
+#include <dm/device_compat.h>
+#include <linux/err.h>
struct sandbox_clk_test {
struct clk clks[SANDBOX_CLK_TEST_NON_DEVM_COUNT];
diff --git a/drivers/clk/clk_versal.c b/drivers/clk/clk_versal.c
index 7e97b0c4bf3..9d4d2149e32 100644
--- a/drivers/clk/clk_versal.c
+++ b/drivers/clk/clk_versal.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <dm/device_compat.h>
#include <linux/bitops.h>
#include <linux/bitfield.h>
#include <malloc.h>
@@ -13,6 +14,7 @@
#include <dm.h>
#include <asm/arch/sys_proto.h>
#include <zynqmp_firmware.h>
+#include <linux/err.h>
#define MAX_PARENT 100
#define MAX_NODES 6
diff --git a/drivers/clk/clk_vexpress_osc.c b/drivers/clk/clk_vexpress_osc.c
index c692a6d0b89..82e589e239f 100644
--- a/drivers/clk/clk_vexpress_osc.c
+++ b/drivers/clk/clk_vexpress_osc.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <dm/device_compat.h>
#include <dm/lists.h>
#include <errno.h>
#include <misc.h>
diff --git a/drivers/clk/clk_zynq.c b/drivers/clk/clk_zynq.c
index b09c37db40f..4ca1cc0d52a 100644
--- a/drivers/clk/clk_zynq.c
+++ b/drivers/clk/clk_zynq.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <dm/device_compat.h>
#include <dm/lists.h>
#include <errno.h>
#include <asm/io.h>
diff --git a/drivers/clk/clk_zynqmp.c b/drivers/clk/clk_zynqmp.c
index 72fc39fa47a..e0eb897da89 100644
--- a/drivers/clk/clk_zynqmp.c
+++ b/drivers/clk/clk_zynqmp.c
@@ -6,11 +6,14 @@
*/
#include <common.h>
+#include <malloc.h>
+#include <dm/device_compat.h>
#include <linux/bitops.h>
#include <clk-uclass.h>
#include <clk.h>
#include <asm/arch/sys_proto.h>
#include <dm.h>
+#include <linux/err.h>
static const resource_size_t zynqmp_crf_apb_clkc_base = 0xfd1a0020;
static const resource_size_t zynqmp_crl_apb_clkc_base = 0xff5e0020;
diff --git a/drivers/clk/imx/clk-composite-8m.c b/drivers/clk/imx/clk-composite-8m.c
index 95120d6559c..3e99c528de5 100644
--- a/drivers/clk/imx/clk-composite-8m.c
+++ b/drivers/clk/imx/clk-composite-8m.c
@@ -8,9 +8,11 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <linux/clk-provider.h>
#include <clk.h>
#include "clk.h"
+#include <linux/err.h>
#define UBOOT_DM_CLK_IMX_COMPOSITE "imx_clk_composite"
diff --git a/drivers/clk/imx/clk-gate2.c b/drivers/clk/imx/clk-gate2.c
index 1b9db6e791f..b38890d5ba5 100644
--- a/drivers/clk/imx/clk-gate2.c
+++ b/drivers/clk/imx/clk-gate2.c
@@ -19,9 +19,11 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <linux/clk-provider.h>
#include <clk.h>
#include "clk.h"
+#include <linux/err.h>
#define UBOOT_DM_CLK_IMX_GATE2 "imx_clk_gate2"
diff --git a/drivers/clk/imx/clk-imx8.c b/drivers/clk/imx/clk-imx8.c
index a755e265016..671054d9bef 100644
--- a/drivers/clk/imx/clk-imx8.c
+++ b/drivers/clk/imx/clk-imx8.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <malloc.h>
#include <asm/arch/sci/sci.h>
#include <asm/arch/clock.h>
#include <dt-bindings/clock/imx8qxp-clock.h>
diff --git a/drivers/clk/imx/clk-pfd.c b/drivers/clk/imx/clk-pfd.c
index 4ae55f5a077..b8be3167c4c 100644
--- a/drivers/clk/imx/clk-pfd.c
+++ b/drivers/clk/imx/clk-pfd.c
@@ -19,10 +19,12 @@
#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_PFD "imx_clk_pfd"
diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
index 2246beb21b2..1673eb26b2c 100644
--- a/drivers/clk/imx/clk-pll14xx.c
+++ b/drivers/clk/imx/clk-pll14xx.c
@@ -10,7 +10,9 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <linux/clk-provider.h>
+#include <linux/err.h>
#include <linux/iopoll.h>
#include <clk.h>
#include <div64.h>
diff --git a/drivers/clk/imx/clk-pllv3.c b/drivers/clk/imx/clk-pllv3.c
index 0cdb9df45d9..525442debf0 100644
--- a/drivers/clk/imx/clk-pllv3.c
+++ b/drivers/clk/imx/clk-pllv3.c
@@ -10,9 +10,11 @@
#include <malloc.h>
#include <clk-uclass.h>
#include <dm/device.h>
+#include <dm/devres.h>
#include <dm/uclass.h>
#include <clk.h>
#include "clk.h"
+#include <linux/err.h>
#define UBOOT_DM_CLK_IMX_PLLV3_GENERIC "imx_clk_pllv3_generic"
#define UBOOT_DM_CLK_IMX_PLLV3_SYS "imx_clk_pllv3_sys"
diff --git a/drivers/clk/meson/axg.c b/drivers/clk/meson/axg.c
index 32cbf752aed..7035b59a137 100644
--- a/drivers/clk/meson/axg.c
+++ b/drivers/clk/meson/axg.c
@@ -15,6 +15,7 @@
#include <div64.h>
#include <dt-bindings/clock/axg-clkc.h>
#include "clk_meson.h"
+#include <linux/err.h>
#define XTAL_RATE 24000000
diff --git a/drivers/clk/meson/g12a.c b/drivers/clk/meson/g12a.c
index 1b2523bbf1f..686d94ebfe8 100644
--- a/drivers/clk/meson/g12a.c
+++ b/drivers/clk/meson/g12a.c
@@ -14,6 +14,7 @@
#include <syscon.h>
#include <div64.h>
#include <dt-bindings/clock/g12a-clkc.h>
+#include <linux/err.h>
#include <linux/kernel.h>
#include "clk_meson.h"
diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c
index abb5337e782..e781e08d9d5 100644
--- a/drivers/clk/meson/gxbb.c
+++ b/drivers/clk/meson/gxbb.c
@@ -15,6 +15,7 @@
#include <syscon.h>
#include <dt-bindings/clock/gxbb-clkc.h>
#include "clk_meson.h"
+#include <linux/err.h>
/* This driver support only basic clock tree operations :
* - Can calculate clock frequency on a limited tree
diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c
index b1a35968e15..068e48ea040 100644
--- a/drivers/clk/mvebu/armada-37xx-periph.c
+++ b/drivers/clk/mvebu/armada-37xx-periph.c
@@ -15,6 +15,7 @@
#include <dm.h>
#include <asm/io.h>
#include <asm/arch/cpu.h>
+#include <dm/device_compat.h>
#define TBG_SEL 0x0
#define DIV_SEL0 0x4
diff --git a/drivers/clk/mvebu/armada-37xx-tbg.c b/drivers/clk/mvebu/armada-37xx-tbg.c
index aa7ccd690f7..233926e9b6a 100644
--- a/drivers/clk/mvebu/armada-37xx-tbg.c
+++ b/drivers/clk/mvebu/armada-37xx-tbg.c
@@ -14,6 +14,7 @@
#include <dm.h>
#include <asm/io.h>
#include <asm/arch/cpu.h>
+#include <dm/device_compat.h>
#define NUM_TBG 4
diff --git a/drivers/clk/rockchip/clk_px30.c b/drivers/clk/rockchip/clk_px30.c
index 36764c128b0..b88534145ef 100644
--- a/drivers/clk/rockchip/clk_px30.c
+++ b/drivers/clk/rockchip/clk_px30.c
@@ -8,6 +8,7 @@
#include <clk-uclass.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <syscon.h>
#include <asm/arch-rockchip/clock.h>
#include <asm/arch-rockchip/cru_px30.h>
diff --git a/drivers/clk/rockchip/clk_rk3036.c b/drivers/clk/rockchip/clk_rk3036.c
index 6d5ae3d0031..6e085c41368 100644
--- a/drivers/clk/rockchip/clk_rk3036.c
+++ b/drivers/clk/rockchip/clk_rk3036.c
@@ -7,6 +7,7 @@
#include <clk-uclass.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch-rockchip/clock.h>
diff --git a/drivers/clk/rockchip/clk_rk3128.c b/drivers/clk/rockchip/clk_rk3128.c
index efda8c830b0..a6f7902941a 100644
--- a/drivers/clk/rockchip/clk_rk3128.c
+++ b/drivers/clk/rockchip/clk_rk3128.c
@@ -7,6 +7,7 @@
#include <clk-uclass.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch-rockchip/clock.h>
diff --git a/drivers/clk/rockchip/clk_rk3188.c b/drivers/clk/rockchip/clk_rk3188.c
index 3ea9a81b324..2b82a40d281 100644
--- a/drivers/clk/rockchip/clk_rk3188.c
+++ b/drivers/clk/rockchip/clk_rk3188.c
@@ -9,6 +9,7 @@
#include <dm.h>
#include <dt-structs.h>
#include <errno.h>
+#include <malloc.h>
#include <mapmem.h>
#include <syscon.h>
#include <asm/io.h>
@@ -20,6 +21,7 @@
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <dm/uclass-internal.h>
+#include <linux/err.h>
#include <linux/log2.h>
enum rk3188_clk_type {
diff --git a/drivers/clk/rockchip/clk_rk322x.c b/drivers/clk/rockchip/clk_rk322x.c
index 6e8a164d622..ef33adbf294 100644
--- a/drivers/clk/rockchip/clk_rk322x.c
+++ b/drivers/clk/rockchip/clk_rk322x.c
@@ -7,6 +7,7 @@
#include <clk-uclass.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch-rockchip/clock.h>
diff --git a/drivers/clk/rockchip/clk_rk3288.c b/drivers/clk/rockchip/clk_rk3288.c
index cc1c1e81e95..81cdb8ee9c7 100644
--- a/drivers/clk/rockchip/clk_rk3288.c
+++ b/drivers/clk/rockchip/clk_rk3288.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <dt-structs.h>
#include <errno.h>
+#include <malloc.h>
#include <mapmem.h>
#include <syscon.h>
#include <asm/io.h>
@@ -21,6 +22,7 @@
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <dm/uclass-internal.h>
+#include <linux/err.h>
#include <linux/log2.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/drivers/clk/rockchip/clk_rk3308.c b/drivers/clk/rockchip/clk_rk3308.c
index f212c5ffc2c..c0f1285e4c7 100644
--- a/drivers/clk/rockchip/clk_rk3308.c
+++ b/drivers/clk/rockchip/clk_rk3308.c
@@ -8,6 +8,7 @@
#include <dm.h>
#include <div64.h>
#include <errno.h>
+#include <malloc.h>
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch/cru_rk3308.h>
diff --git a/drivers/clk/rockchip/clk_rk3328.c b/drivers/clk/rockchip/clk_rk3328.c
index e700a1bc25c..8e867c58dfe 100644
--- a/drivers/clk/rockchip/clk_rk3328.c
+++ b/drivers/clk/rockchip/clk_rk3328.c
@@ -8,6 +8,7 @@
#include <clk-uclass.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <syscon.h>
#include <asm/arch-rockchip/clock.h>
#include <asm/arch-rockchip/cru_rk3328.h>
diff --git a/drivers/clk/rockchip/clk_rk3368.c b/drivers/clk/rockchip/clk_rk3368.c
index b51d529adea..2cce1b967d1 100644
--- a/drivers/clk/rockchip/clk_rk3368.c
+++ b/drivers/clk/rockchip/clk_rk3368.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <dt-structs.h>
#include <errno.h>
+#include <malloc.h>
#include <mapmem.h>
#include <syscon.h>
#include <bitfield.h>
diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c
index 37fc142a7a8..865b80cc0fb 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -9,6 +9,7 @@
#include <dm.h>
#include <dt-structs.h>
#include <errno.h>
+#include <malloc.h>
#include <mapmem.h>
#include <syscon.h>
#include <bitfield.h>
diff --git a/drivers/clk/rockchip/clk_rv1108.c b/drivers/clk/rockchip/clk_rv1108.c
index 97fdd099ef3..da9c48b962a 100644
--- a/drivers/clk/rockchip/clk_rv1108.c
+++ b/drivers/clk/rockchip/clk_rv1108.c
@@ -9,6 +9,7 @@
#include <clk-uclass.h>
#include <dm.h>
#include <errno.h>
+#include <malloc.h>
#include <syscon.h>
#include <asm/io.h>
#include <asm/arch-rockchip/clock.h>
diff --git a/drivers/clk/sifive/fu540-prci.c b/drivers/clk/sifive/fu540-prci.c
index ce0769f2d13..8847178001b 100644
--- a/drivers/clk/sifive/fu540-prci.c
+++ b/drivers/clk/sifive/fu540-prci.c
@@ -35,6 +35,7 @@
#include <div64.h>
#include <dm.h>
#include <errno.h>
+#include <linux/err.h>
#include <linux/math64.h>
#include <linux/clk/analogbits-wrpll-cln28hpc.h>
diff --git a/drivers/clk/tegra/tegra-car-clk.c b/drivers/clk/tegra/tegra-car-clk.c
index 98be7602b3d..6083f14e751 100644
--- a/drivers/clk/tegra/tegra-car-clk.c
+++ b/drivers/clk/tegra/tegra-car-clk.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <malloc.h>
#include <asm/arch/clock.h>
#include <asm/arch-tegra/clk_rst.h>
@@ -80,7 +81,7 @@ static int tegra_car_clk_disable(struct clk *clk)
static struct clk_ops tegra_car_clk_ops = {
.request = tegra_car_clk_request,
- .free = tegra_car_clk_free,
+ .rfree = tegra_car_clk_free,
.get_rate = tegra_car_clk_get_rate,
.set_rate = tegra_car_clk_set_rate,
.enable = tegra_car_clk_enable,
diff --git a/drivers/clk/uniphier/clk-uniphier-core.c b/drivers/clk/uniphier/clk-uniphier-core.c
index 1da63819e7d..9f240509925 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <clk-uclass.h>
#include <dm.h>
+#include <dm/device_compat.h>
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/sizes.h>