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/spi | |
parent | 82719d3f409f93b2ce85145547c0bb91624a2c63 (diff) | |
download | u-boot-c9309f40a6831b1ac5cd0a7227b5c3717d34c812.tar.gz u-boot-c9309f40a6831b1ac5cd0a7227b5c3717d34c812.tar.bz2 u-boot-c9309f40a6831b1ac5cd0a7227b5c3717d34c812.zip |
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/spi')
-rw-r--r-- | drivers/spi/atcspi200_spi.c | 1 | ||||
-rw-r--r-- | drivers/spi/atmel-quadspi.c | 14 | ||||
-rw-r--r-- | drivers/spi/atmel_spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/bcm63xx_hsspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/bcm63xx_spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/bcmbca_hsspi.c | 4 | ||||
-rw-r--r-- | drivers/spi/cadence_qspi.c | 1 | ||||
-rw-r--r-- | drivers/spi/designware_spi.c | 5 | ||||
-rw-r--r-- | drivers/spi/meson_spifc_a1.c | 10 | ||||
-rw-r--r-- | drivers/spi/mvebu_a3700_spi.c | 10 | ||||
-rw-r--r-- | drivers/spi/spi-aspeed-smc.c | 1 | ||||
-rw-r--r-- | drivers/spi/stm32_spi.c | 19 |
12 files changed, 7 insertions, 66 deletions
diff --git a/drivers/spi/atcspi200_spi.c b/drivers/spi/atcspi200_spi.c index de9c14837c..70cb242cd3 100644 --- a/drivers/spi/atcspi200_spi.c +++ b/drivers/spi/atcspi200_spi.c @@ -362,7 +362,6 @@ static int atcspi200_spi_get_clk(struct udevice *bus) return -EINVAL; ns->clock = clk_rate; - clk_free(&clk); return 0; } diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c index cb64119f97..bd73e4fddf 100644 --- a/drivers/spi/atmel-quadspi.c +++ b/drivers/spi/atmel-quadspi.c @@ -877,7 +877,6 @@ static int atmel_qspi_set_gclk(struct udevice *bus, uint hz) ret = clk_enable(&gclk); if (ret) dev_err(bus, "Failed to enable QSPI generic clock\n"); - clk_free(&gclk); return ret; } @@ -1000,7 +999,7 @@ static int atmel_qspi_enable_clk(struct udevice *dev) ret = clk_enable(&pclk); if (ret) { dev_err(dev, "Failed to enable QSPI peripheral clock\n"); - goto free_pclk; + return ret; } if (aq->caps->has_qspick) { @@ -1008,32 +1007,27 @@ static int atmel_qspi_enable_clk(struct udevice *dev) ret = clk_get_by_name(dev, "qspick", &qspick); if (ret) { dev_err(dev, "Missing QSPI peripheral clock\n"); - goto free_pclk; + return ret; } ret = clk_enable(&qspick); if (ret) dev_err(dev, "Failed to enable QSPI system clock\n"); - clk_free(&qspick); } else if (aq->caps->has_gclk) { ret = clk_get_by_name(dev, "gclk", &gclk); if (ret) { dev_err(dev, "Missing QSPI generic clock\n"); - goto free_pclk; + return ret; } ret = clk_enable(&gclk); if (ret) dev_err(dev, "Failed to enable QSPI system clock\n"); - clk_free(&gclk); } aq->bus_clk_rate = clk_get_rate(&pclk); if (!aq->bus_clk_rate) - ret = -EINVAL; - -free_pclk: - clk_free(&pclk); + return -EINVAL; return ret; } diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index aec6f4eca9..d4f0c4c448 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c @@ -338,8 +338,6 @@ static int atmel_spi_enable_clk(struct udevice *bus) priv->bus_clk_rate = clk_rate; - clk_free(&clk); - return 0; } diff --git a/drivers/spi/bcm63xx_hsspi.c b/drivers/spi/bcm63xx_hsspi.c index 19d9a5ae23..23ac5bb76c 100644 --- a/drivers/spi/bcm63xx_hsspi.c +++ b/drivers/spi/bcm63xx_hsspi.c @@ -581,8 +581,6 @@ static int bcm63xx_hsspi_probe(struct udevice *dev) if (ret < 0 && ret != -ENOSYS) return ret; - clk_free(&clk); - /* get clock rate */ ret = clk_get_by_name(dev, "pll", &clk); if (ret < 0 && ret != -ENOSYS) @@ -590,8 +588,6 @@ static int bcm63xx_hsspi_probe(struct udevice *dev) priv->clk_rate = clk_get_rate(&clk); - clk_free(&clk); - /* perform reset */ ret = reset_get_by_index(dev, 0, &rst_ctl); if (ret >= 0) { diff --git a/drivers/spi/bcm63xx_spi.c b/drivers/spi/bcm63xx_spi.c index 0600d56c69..889ac1f966 100644 --- a/drivers/spi/bcm63xx_spi.c +++ b/drivers/spi/bcm63xx_spi.c @@ -391,8 +391,6 @@ static int bcm63xx_spi_probe(struct udevice *dev) if (ret < 0) return ret; - clk_free(&clk); - /* perform reset */ ret = reset_get_by_index(dev, 0, &rst_ctl); if (ret < 0) diff --git a/drivers/spi/bcmbca_hsspi.c b/drivers/spi/bcmbca_hsspi.c index fbe315a7d4..af45882db0 100644 --- a/drivers/spi/bcmbca_hsspi.c +++ b/drivers/spi/bcmbca_hsspi.c @@ -375,8 +375,6 @@ static int bcmbca_hsspi_probe(struct udevice *dev) if (ret < 0 && ret != -ENOSYS) return ret; - clk_free(&clk); - /* get clock rate */ ret = clk_get_by_name(dev, "pll", &clk); if (ret < 0 && ret != -ENOSYS) @@ -384,8 +382,6 @@ static int bcmbca_hsspi_probe(struct udevice *dev) priv->clk_rate = clk_get_rate(&clk); - clk_free(&clk); - /* initialize hardware */ writel(0, priv->regs + SPI_IR_MASK_REG); diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index dfc74c882d..f4593c47b8 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -236,7 +236,6 @@ static int cadence_spi_probe(struct udevice *bus) #endif } else { priv->ref_clk_hz = clk_get_rate(&clk); - clk_free(&clk); if (IS_ERR_VALUE(priv->ref_clk_hz)) return priv->ref_clk_hz; } diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c index 98908c5217..22a79da233 100644 --- a/drivers/spi/designware_spi.c +++ b/drivers/spi/designware_spi.c @@ -319,7 +319,6 @@ __weak int dw_spi_get_clk(struct udevice *bus, ulong *rate) err_rate: clk_disable(&priv->clk); - clk_free(&priv->clk); return -EINVAL; } @@ -743,10 +742,6 @@ static int dw_spi_remove(struct udevice *bus) ret = clk_disable(&priv->clk); if (ret) return ret; - - clk_free(&priv->clk); - if (ret) - return ret; #endif return 0; } diff --git a/drivers/spi/meson_spifc_a1.c b/drivers/spi/meson_spifc_a1.c index cca4debb41..943bf6986f 100644 --- a/drivers/spi/meson_spifc_a1.c +++ b/drivers/spi/meson_spifc_a1.c @@ -343,15 +343,6 @@ static int amlogic_spifc_a1_probe(struct udevice *dev) return 0; } -static int amlogic_spifc_a1_remove(struct udevice *dev) -{ - struct amlogic_spifc_a1 *spifc = dev_get_priv(dev); - - clk_free(&spifc->clk); - - return 0; -} - static const struct udevice_id meson_spifc_ids[] = { { .compatible = "amlogic,a1-spifc", }, { } @@ -379,6 +370,5 @@ U_BOOT_DRIVER(meson_spifc_a1) = { .of_match = meson_spifc_ids, .ops = &amlogic_spifc_a1_ops, .probe = amlogic_spifc_a1_probe, - .remove = amlogic_spifc_a1_remove, .priv_auto = sizeof(struct amlogic_spifc_a1), }; diff --git a/drivers/spi/mvebu_a3700_spi.c b/drivers/spi/mvebu_a3700_spi.c index 52882e8b26..bba2383a11 100644 --- a/drivers/spi/mvebu_a3700_spi.c +++ b/drivers/spi/mvebu_a3700_spi.c @@ -296,15 +296,6 @@ static int mvebu_spi_of_to_plat(struct udevice *bus) return 0; } -static int mvebu_spi_remove(struct udevice *bus) -{ - struct mvebu_spi_plat *plat = dev_get_plat(bus); - - clk_free(&plat->clk); - - return 0; -} - static const struct dm_spi_ops mvebu_spi_ops = { .xfer = mvebu_spi_xfer, .set_speed = mvebu_spi_set_speed, @@ -328,5 +319,4 @@ U_BOOT_DRIVER(mvebu_spi) = { .of_to_plat = mvebu_spi_of_to_plat, .plat_auto = sizeof(struct mvebu_spi_plat), .probe = mvebu_spi_probe, - .remove = mvebu_spi_remove, }; diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c index 3962031021..7d5f101a76 100644 --- a/drivers/spi/spi-aspeed-smc.c +++ b/drivers/spi/spi-aspeed-smc.c @@ -1148,7 +1148,6 @@ static int apseed_spi_of_to_plat(struct udevice *bus) } plat->hclk_rate = clk_get_rate(&hclk); - clk_free(&hclk); dev_dbg(bus, "ctrl_base = 0x%x, ahb_base = 0x%p, size = 0x%llx\n", (u32)priv->regs, plat->ahb_base, (fdt64_t)plat->ahb_sz); diff --git a/drivers/spi/stm32_spi.c b/drivers/spi/stm32_spi.c index 82f6ed783f..ddb410a94c 100644 --- a/drivers/spi/stm32_spi.c +++ b/drivers/spi/stm32_spi.c @@ -526,22 +526,16 @@ static int stm32_spi_of_to_plat(struct udevice *dev) ret = reset_get_by_index(dev, 0, &plat->rst_ctl); if (ret < 0) - goto clk_err; + return ret; ret = gpio_request_list_by_name(dev, "cs-gpios", plat->cs_gpios, ARRAY_SIZE(plat->cs_gpios), 0); if (ret < 0) { dev_err(dev, "Can't get %s cs gpios: %d", dev->name, ret); - ret = -ENOENT; - goto clk_err; + return -ENOENT; } return 0; - -clk_err: - clk_free(&plat->clk); - - return ret; } static int stm32_spi_probe(struct udevice *dev) @@ -610,7 +604,6 @@ static int stm32_spi_probe(struct udevice *dev) clk_err: clk_disable(&plat->clk); - clk_free(&plat->clk); return ret; }; @@ -630,13 +623,7 @@ static int stm32_spi_remove(struct udevice *dev) reset_free(&plat->rst_ctl); - ret = clk_disable(&plat->clk); - if (ret < 0) - return ret; - - clk_free(&plat->clk); - - return ret; + return clk_disable(&plat->clk); }; static const struct dm_spi_ops stm32_spi_ops = { |