summaryrefslogtreecommitdiff
path: root/drivers/reset/reset-sunxi.c
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2022-05-09 00:29:33 -0500
committerAndre Przywara <andre.przywara@arm.com>2022-07-18 09:37:49 +0100
commitd39088ad9c97fa612c480475b18759a3931c41fd (patch)
tree33e296d56ebb595a843dc4e803aa6902453c9d09 /drivers/reset/reset-sunxi.c
parent6827aba3482d214afea3b3bc4cb2f5bddb606929 (diff)
downloadu-boot-d39088ad9c97fa612c480475b18759a3931c41fd.tar.gz
reset: sunxi: Get the reset count from the CCU descriptor
This allows all of the clock drivers to use a common bind function. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> [Andre: add F1C100s support] Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/reset/reset-sunxi.c')
-rw-r--r--drivers/reset/reset-sunxi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/reset/reset-sunxi.c b/drivers/reset/reset-sunxi.c
index e2a9c2a142..621912ad23 100644
--- a/drivers/reset/reset-sunxi.c
+++ b/drivers/reset/reset-sunxi.c
@@ -19,7 +19,6 @@
struct sunxi_reset_priv {
void *base;
- ulong count;
const struct ccu_desc *desc;
};
@@ -35,7 +34,7 @@ static int sunxi_reset_request(struct reset_ctl *reset_ctl)
debug("%s: (RST#%ld)\n", __func__, reset_ctl->id);
- if (reset_ctl->id >= priv->count)
+ if (reset_ctl->id >= priv->desc->num_resets)
return -EINVAL;
return 0;
@@ -91,7 +90,7 @@ static int sunxi_reset_probe(struct udevice *dev)
return 0;
}
-int sunxi_reset_bind(struct udevice *dev, ulong count)
+int sunxi_reset_bind(struct udevice *dev)
{
struct udevice *rst_dev;
struct sunxi_reset_priv *priv;
@@ -104,7 +103,6 @@ int sunxi_reset_bind(struct udevice *dev, ulong count)
return ret;
}
priv = malloc(sizeof(struct sunxi_reset_priv));
- priv->count = count;
priv->desc = (const struct ccu_desc *)dev_get_driver_data(dev);
dev_set_priv(rst_dev, priv);