diff options
author | Sean Anderson <seanga2@gmail.com> | 2023-12-16 14:38:42 -0500 |
---|---|---|
committer | Sean Anderson <seanga2@gmail.com> | 2024-01-29 22:35:02 -0500 |
commit | c9309f40a6831b1ac5cd0a7227b5c3717d34c812 (patch) | |
tree | 2c331967b5ad82ae7ba565e4234dbfb5d8e3e048 /drivers/clk | |
parent | 82719d3f409f93b2ce85145547c0bb91624a2c63 (diff) | |
download | u-boot-c9309f40a6831b1ac5cd0a7227b5c3717d34c812.zip u-boot-c9309f40a6831b1ac5cd0a7227b5c3717d34c812.tar.gz u-boot-c9309f40a6831b1ac5cd0a7227b5c3717d34c812.tar.bz2 |
treewide: Remove clk_free
This function is a no-op. Remove it.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231216193843.2463779-3-seanga2@gmail.com
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/aspeed/clk_ast2600.c | 2 | ||||
-rw-r--r-- | drivers/clk/at91/compat.c | 14 | ||||
-rw-r--r-- | drivers/clk/clk-uclass.c | 26 | ||||
-rw-r--r-- | drivers/clk/clk-xlnx-clock-wizard.c | 1 | ||||
-rw-r--r-- | drivers/clk/clk_versaclock.c | 12 | ||||
-rw-r--r-- | drivers/clk/clk_zynq.c | 2 | ||||
-rw-r--r-- | drivers/clk/clk_zynqmp.c | 2 | ||||
-rw-r--r-- | drivers/clk/imx/clk-imx8.c | 2 | ||||
-rw-r--r-- | drivers/clk/mvebu/armada-37xx-periph.c | 2 |
9 files changed, 5 insertions, 58 deletions
diff --git a/drivers/clk/aspeed/clk_ast2600.c b/drivers/clk/aspeed/clk_ast2600.c index eecfacd..a159093 100644 --- a/drivers/clk/aspeed/clk_ast2600.c +++ b/drivers/clk/aspeed/clk_ast2600.c @@ -1143,8 +1143,6 @@ static void ast2600_clk_dump(struct udevice *dev) ret = clk_get_rate(&clk); rate = ret; - clk_free(&clk); - if (ret == -EINVAL) { printf("clk ID %lu not supported yet\n", aspeed_clk_names[i].id); diff --git a/drivers/clk/at91/compat.c b/drivers/clk/at91/compat.c index 2fdc2fb..ee67093 100644 --- a/drivers/clk/at91/compat.c +++ b/drivers/clk/at91/compat.c @@ -516,7 +516,6 @@ static ulong periph_get_rate(struct clk *clk) { struct udevice *dev; struct clk clk_dev; - ulong clk_rate; int ret; dev = dev_get_parent(clk->dev); @@ -525,11 +524,7 @@ static ulong periph_get_rate(struct clk *clk) if (ret) return ret; - clk_rate = clk_get_rate(&clk_dev); - - clk_free(&clk_dev); - - return clk_rate; + return clk_get_rate(&clk_dev); } static struct clk_ops periph_clk_ops = { @@ -762,7 +757,6 @@ static ulong generic_clk_get_rate(struct clk *clk) struct pmc_plat *plat = dev_get_plat(clk->dev); struct at91_pmc *pmc = plat->reg_base; struct clk parent; - ulong clk_rate; u32 tmp, gckdiv; u8 clock_source, parent_index; int ret; @@ -778,11 +772,7 @@ static ulong generic_clk_get_rate(struct clk *clk) if (ret) return 0; - clk_rate = clk_get_rate(&parent) / (gckdiv + 1); - - clk_free(&parent); - - return clk_rate; + return clk_get_rate(&parent) / (gckdiv + 1); } static ulong generic_clk_set_rate(struct clk *clk, ulong rate) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 4bd2d8c..ed6e60b 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -437,8 +437,6 @@ int clk_release_all(struct clk *clk, unsigned int count) ret = clk_disable(&clk[i]); if (ret && ret != -ENOSYS) return ret; - - clk_free(&clk[i]); } return 0; @@ -772,22 +770,12 @@ bool clk_is_match(const struct clk *p, const struct clk *q) return false; } -static void devm_clk_release(struct udevice *dev, void *res) -{ - clk_free(res); -} - -static int devm_clk_match(struct udevice *dev, void *res, void *data) -{ - return res == data; -} - struct clk *devm_clk_get(struct udevice *dev, const char *id) { int rc; struct clk *clk; - clk = devres_alloc(devm_clk_release, sizeof(struct clk), __GFP_ZERO); + clk = devm_kzalloc(dev, sizeof(*clk), GFP_KERNEL); if (unlikely(!clk)) return ERR_PTR(-ENOMEM); @@ -795,21 +783,9 @@ struct clk *devm_clk_get(struct udevice *dev, const char *id) if (rc) return ERR_PTR(rc); - devres_add(dev, clk); return clk; } -void devm_clk_put(struct udevice *dev, struct clk *clk) -{ - int rc; - - if (!clk) - return; - - rc = devres_release(dev, devm_clk_release, devm_clk_match, clk); - WARN_ON(rc); -} - int clk_uclass_post_probe(struct udevice *dev) { /* diff --git a/drivers/clk/clk-xlnx-clock-wizard.c b/drivers/clk/clk-xlnx-clock-wizard.c index 70ee3af..a10a843 100644 --- a/drivers/clk/clk-xlnx-clock-wizard.c +++ b/drivers/clk/clk-xlnx-clock-wizard.c @@ -137,7 +137,6 @@ static int clk_wzrd_probe(struct udevice *dev) ret = clk_enable(&clk_in1); if (ret) { dev_err(dev, "failed to enable clock\n"); - clk_free(&clk_in1); return ret; } diff --git a/drivers/clk/clk_versaclock.c b/drivers/clk/clk_versaclock.c index 699df3c..bbe7225 100644 --- a/drivers/clk/clk_versaclock.c +++ b/drivers/clk/clk_versaclock.c @@ -1000,26 +1000,18 @@ int versaclock_probe(struct udevice *dev) return 0; free_out: - for (n = 1; n < vc5->chip_info->clk_out_cnt; n++) { - clk_free(&vc5->clk_out[n].hw); + for (n = 1; n < vc5->chip_info->clk_out_cnt; n++) free(out_name[n]); - } free_selb: - clk_free(&vc5->clk_out[0].hw); free(outsel_name); free_fod: - for (n = 0; n < vc5->chip_info->clk_fod_cnt; n++) { - clk_free(&vc5->clk_fod[n].hw); + for (n = 0; n < vc5->chip_info->clk_fod_cnt; n++) free(fod_name[n]); - } free_pll: - clk_free(&vc5->clk_pll.hw); free(pll_name); free_pfd: - clk_free(&vc5->clk_pfd); free(pfd_name); free_mux: - clk_free(&vc5->clk_mux); free(mux_name); return ret; diff --git a/drivers/clk/clk_zynq.c b/drivers/clk/clk_zynq.c index 34f964d..e3cefe2 100644 --- a/drivers/clk/clk_zynq.c +++ b/drivers/clk/clk_zynq.c @@ -491,8 +491,6 @@ static void zynq_clk_dump(struct udevice *dev) rate = clk_get_rate(&clk); - clk_free(&clk); - if ((rate == (unsigned long)-ENOSYS) || (rate == (unsigned long)-ENXIO)) printf("%10s%20s\n", name, "unknown"); diff --git a/drivers/clk/clk_zynqmp.c b/drivers/clk/clk_zynqmp.c index 0ffac19..e23f7da 100644 --- a/drivers/clk/clk_zynqmp.c +++ b/drivers/clk/clk_zynqmp.c @@ -757,8 +757,6 @@ static void zynqmp_clk_dump(struct udevice *dev) rate = clk_get_rate(&clk); - clk_free(&clk); - if ((rate == (unsigned long)-ENOSYS) || (rate == (unsigned long)-ENXIO) || (rate == (unsigned long)-EIO)) diff --git a/drivers/clk/imx/clk-imx8.c b/drivers/clk/imx/clk-imx8.c index 9600672..d39b87b 100644 --- a/drivers/clk/imx/clk-imx8.c +++ b/drivers/clk/imx/clk-imx8.c @@ -62,8 +62,6 @@ static void imx8_clk_dump(struct udevice *dev) ret = clk_get_rate(&clk); rate = ret; - clk_free(&clk); - if (ret == -EINVAL) { printf("clk ID %lu not supported yet\n", imx8_clk_names[i].id); diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c index 1a70970..f5c9bd7 100644 --- a/drivers/clk/mvebu/armada-37xx-periph.c +++ b/drivers/clk/mvebu/armada-37xx-periph.c @@ -454,7 +454,6 @@ static int armada_37xx_periph_clk_set_parent(struct clk *clk, if (parent->dev != check_parent.dev) ret = -EINVAL; - clk_free(&check_parent); if (ret < 0) return ret; @@ -596,7 +595,6 @@ static int armada_37xx_periph_clk_probe(struct udevice *dev) } priv->parents[i] = clk_get_rate(&clk); - clk_free(&clk); } return 0; |