summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2022-05-09 08:29:37 +0300
committerAndre Przywara <andre.przywara@arm.com>2022-07-18 11:37:50 +0300
commit66391263f8484aae41cae80753f31c0edc6138af (patch)
treefca2526eaa4f994ea299eb0a8e057b88532d8bfa /drivers/clk
parent3fb1988aad29185409a9e05a1111b7e2b7e5f8fc (diff)
downloadu-boot-66391263f8484aae41cae80753f31c0edc6138af.tar.xz
reset: sunxi: Reuse the platform data from the clock driver
The clock and reset drivers use the exact same platform data. Simplify them by sharing the object. This is safe because the parent device (the clock device) always gets its driver model callbacks run first. Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/sunxi/clk_sunxi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/sunxi/clk_sunxi.c b/drivers/clk/sunxi/clk_sunxi.c
index 5b208c9b34..ec02a2d037 100644
--- a/drivers/clk/sunxi/clk_sunxi.c
+++ b/drivers/clk/sunxi/clk_sunxi.c
@@ -12,9 +12,12 @@
#include <reset.h>
#include <asm/io.h>
#include <clk/sunxi.h>
+#include <dm/device-internal.h>
#include <linux/bitops.h>
#include <linux/log2.h>
+extern U_BOOT_DRIVER(sunxi_reset);
+
static const struct ccu_clk_gate *plat_to_gate(struct ccu_plat *plat,
unsigned long id)
{
@@ -69,7 +72,9 @@ struct clk_ops sunxi_clk_ops = {
static int sunxi_clk_bind(struct udevice *dev)
{
- return sunxi_reset_bind(dev);
+ /* Reuse the platform data for the reset driver. */
+ return device_bind(dev, DM_DRIVER_REF(sunxi_reset), "reset",
+ dev_get_plat(dev), dev_ofnode(dev), NULL);
}
static int sunxi_clk_probe(struct udevice *dev)