Convert to use the rockchip_sysreset_bind() helper to bind the
rockchip_sysreset driver.

Signed-off-by: Jonas Karlman <[email protected]>
---
 drivers/clk/rockchip/clk_rk3528.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/rockchip/clk_rk3528.c 
b/drivers/clk/rockchip/clk_rk3528.c
index 976ef0e0a919..b125e5f77021 100644
--- a/drivers/clk/rockchip/clk_rk3528.c
+++ b/drivers/clk/rockchip/clk_rk3528.c
@@ -1711,8 +1711,6 @@ static int rk3528_clk_ofdata_to_platdata(struct udevice 
*dev)
 
 static int rk3528_clk_bind(struct udevice *dev)
 {
-       struct udevice *sys_child;
-       struct sysreset_reg *priv;
        int ret;
 
        /* Ensure clocks are initialized after bind in SPL build */
@@ -1720,18 +1718,12 @@ static int rk3528_clk_bind(struct udevice *dev)
                dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND);
 
        /* The reset driver does not have a device node, so bind it here */
-       ret = device_bind_driver(dev, "rockchip_sysreset", "sysreset",
-                                &sys_child);
-       if (ret) {
+       ret = rockchip_sysreset_bind(dev, (unsigned long)RK3528_CRU_BASE,
+                                    offsetof(struct rk3528_cru, glb_rst_st),
+                                    offsetof(struct rk3528_cru, glb_srst_fst),
+                                    offsetof(struct rk3528_cru, glb_srst_snd));
+       if (ret)
                debug("Warning: No sysreset driver: ret=%d\n", ret);
-       } else {
-               priv = malloc(sizeof(struct sysreset_reg));
-               priv->glb_srst_fst_value = offsetof(struct rk3528_cru,
-                                                   glb_srst_fst);
-               priv->glb_srst_snd_value = offsetof(struct rk3528_cru,
-                                                   glb_srst_snd);
-               dev_set_priv(sys_child, priv);
-       }
 
 #if CONFIG_IS_ENABLED(RESET_ROCKCHIP)
        ret = offsetof(struct rk3528_cru, softrst_con[0]);
-- 
2.54.0

Reply via email to