]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: Remove rfree
authorSean Anderson <seanga2@gmail.com>
Sat, 16 Dec 2023 19:38:41 +0000 (14:38 -0500)
committerSean Anderson <seanga2@gmail.com>
Tue, 30 Jan 2024 03:35:02 +0000 (22:35 -0500)
Nothing uses this function. Remove it. Since clk_free no longer does
anything, just stub it out.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231216193843.2463779-2-seanga2@gmail.com
arch/sandbox/include/asm/clk.h
drivers/clk/clk-uclass.c
drivers/clk/clk_sandbox.c
drivers/clk/clk_sandbox_test.c
include/clk-uclass.h
include/clk.h
test/dm/clk.c

index d4e04ad148612c867944bccdf34c4419930f482b..37fe49c7fcf61a0d172dad8539f510431b9ab59d 100644 (file)
@@ -181,14 +181,6 @@ int sandbox_clk_test_disable(struct udevice *dev, int id);
  * @return:    0 if OK, or a negative error code.
  */
 int sandbox_clk_test_disable_bulk(struct udevice *dev);
-/**
- * sandbox_clk_test_free - Ask the sandbox clock test device to free its
- * clocks.
- *
- * @dev:       The sandbox clock test (client) device.
- * @return:    0 if OK, or a negative error code.
- */
-int sandbox_clk_test_free(struct udevice *dev);
 /**
  * sandbox_clk_test_release_bulk - Ask the sandbox clock test device to release
  * all clocks in it's clock bulk struct.
index d5e20071859e91467d7d52f52a1dae98d1ca153b..4bd2d8c26282002dc7e4ba4e900e649cf52c0f46 100644 (file)
@@ -461,20 +461,6 @@ int clk_request(struct udevice *dev, struct clk *clk)
        return ops->request(clk);
 }
 
-void clk_free(struct clk *clk)
-{
-       const struct clk_ops *ops;
-
-       debug("%s(clk=%p)\n", __func__, clk);
-       if (!clk_valid(clk))
-               return;
-       ops = clk_dev_ops(clk->dev);
-
-       if (ops->rfree)
-               ops->rfree(clk);
-       return;
-}
-
 ulong clk_get_rate(struct clk *clk)
 {
        const struct clk_ops *ops;
index 636914db8ca20ed1b42ea82222aa1221ef8952ab..73d943f9e092313576e3a45018358c5564a8519e 100644 (file)
@@ -101,17 +101,6 @@ static int sandbox_clk_request(struct clk *clk)
        return 0;
 }
 
-static void sandbox_clk_free(struct clk *clk)
-{
-       struct sandbox_clk_priv *priv = dev_get_priv(clk->dev);
-
-       if (clk->id >= SANDBOX_CLK_ID_COUNT)
-               return;
-
-       priv->requested[clk->id] = false;
-       return;
-}
-
 static struct clk_ops sandbox_clk_ops = {
        .round_rate     = sandbox_clk_round_rate,
        .get_rate       = sandbox_clk_get_rate,
@@ -119,7 +108,6 @@ static struct clk_ops sandbox_clk_ops = {
        .enable         = sandbox_clk_enable,
        .disable        = sandbox_clk_disable,
        .request        = sandbox_clk_request,
-       .rfree          = sandbox_clk_free,
 };
 
 static int sandbox_clk_probe(struct udevice *dev)
index c695b69321e2ecb7cb6fbc35a6d9dedb735da97e..c224dc1d2cb9573f7fff1da9338a50663e31f55b 100644 (file)
@@ -135,18 +135,6 @@ int sandbox_clk_test_disable_bulk(struct udevice *dev)
        return clk_disable_bulk(&sbct->bulk);
 }
 
-int sandbox_clk_test_free(struct udevice *dev)
-{
-       struct sandbox_clk_test *sbct = dev_get_priv(dev);
-       int i;
-
-       devm_clk_put(dev, sbct->clkps[SANDBOX_CLK_TEST_ID_DEVM1]);
-       for (i = 0; i < SANDBOX_CLK_TEST_NON_DEVM_COUNT; i++)
-               clk_free(&sbct->clks[i]);
-
-       return 0;
-}
-
 int sandbox_clk_test_release_bulk(struct udevice *dev)
 {
        struct sandbox_clk_test *sbct = dev_get_priv(dev);
index cd62848bece3bf45682645bcb3a6cd9bc085a21c..4353b664800a9d308bb9e9fa849424bde12c6de8 100644 (file)
@@ -18,7 +18,6 @@ struct ofnode_phandle_args;
  * struct clk_ops - The functions that a clock driver must implement.
  * @of_xlate: Translate a client's device-tree (OF) clock specifier.
  * @request: Request a translated clock.
- * @rfree: Free a previously requested clock.
  * @round_rate: Adjust a rate to the exact rate a clock can provide.
  * @get_rate: Get current clock rate.
  * @set_rate: Set current clock rate.
@@ -33,7 +32,6 @@ struct clk_ops {
        int (*of_xlate)(struct clk *clock,
                        struct ofnode_phandle_args *args);
        int (*request)(struct clk *clock);
-       void (*rfree)(struct clk *clock);
        ulong (*round_rate)(struct clk *clk, ulong rate);
        ulong (*get_rate)(struct clk *clk);
        ulong (*set_rate)(struct clk *clk, ulong rate);
@@ -81,14 +79,6 @@ int of_xlate(struct clk *clock, struct ofnode_phandle_args *args);
  */
 int request(struct clk *clock);
 
-/**
- * rfree() - Free a previously requested clock.
- * @clock:     The clock to free.
- *
- * Free any resources allocated in request().
- */
-void rfree(struct clk *clock);
-
 /**
  * round_rate() - Adjust a rate to the exact rate a clock can provide.
  * @clk:       The clock to manipulate.
index 3d6394477be015ee07b8220238fb852f6936d46f..ea5f6bd6f792c6b6b5a598f0a9c2f6ea55f77869 100644 (file)
@@ -424,6 +424,10 @@ static inline int clk_release_bulk(struct clk_bulk *bulk)
        return clk_release_all(bulk->clks, bulk->count);
 }
 
+static inline void clk_free(struct clk *clk)
+{
+}
+
 #if CONFIG_IS_ENABLED(CLK)
 /**
  * clk_request() - Request a clock by provider-specific ID.
@@ -441,15 +445,6 @@ static inline int clk_release_bulk(struct clk_bulk *bulk)
  */
 int clk_request(struct udevice *dev, struct clk *clk);
 
-/**
- * clk_free() - Free a previously requested clock.
- * @clk:       A clock struct that was previously successfully requested by
- *             clk_request/get_by_*().
- *
- * Free resources allocated by clk_request() (or any clk_get_* function).
- */
-void clk_free(struct clk *clk);
-
 /**
  * clk_get_rate() - Get current clock rate.
  * @clk:       A clock struct that was previously successfully requested by
@@ -594,11 +589,6 @@ static inline int clk_request(struct udevice *dev, struct clk *clk)
        return -ENOSYS;
 }
 
-static inline void clk_free(struct clk *clk)
-{
-       return;
-}
-
 static inline ulong clk_get_rate(struct clk *clk)
 {
        return -ENOSYS;
index 01417fbd8257d5149aa637959c2a30b350633f2c..57fabbdce08b31a15506870c2466105ab8fa72e3 100644 (file)
@@ -182,19 +182,10 @@ static int dm_test_clk(struct unit_test_state *uts)
                                                   SANDBOX_CLK_ID_I2C));
        ut_asserteq(1, sandbox_clk_query_requested(dev_clk,
                                                   SANDBOX_CLK_ID_UART2));
-       ut_assertok(sandbox_clk_test_free(dev_test));
-       ut_asserteq(0, sandbox_clk_query_requested(dev_clk,
-                                                  SANDBOX_CLK_ID_SPI));
-       ut_asserteq(0, sandbox_clk_query_requested(dev_clk,
-                                                  SANDBOX_CLK_ID_I2C));
-       ut_asserteq(0, sandbox_clk_query_requested(dev_clk,
-                                                  SANDBOX_CLK_ID_UART2));
 
        ut_asserteq(1, sandbox_clk_query_requested(dev_clk,
                                                   SANDBOX_CLK_ID_UART1));
        ut_assertok(device_remove(dev_test, DM_REMOVE_NORMAL));
-       ut_asserteq(0, sandbox_clk_query_requested(dev_clk,
-                                                  SANDBOX_CLK_ID_UART1));
        return 0;
 }
 DM_TEST(dm_test_clk, UT_TESTF_SCAN_FDT);