Commit e5a4b9b9 authored by Jerome Brunet's avatar Jerome Brunet Committed by Stephen Boyd

clk: avoid devm_clk_release name clash

In clk-devres.c, devm_clk_release() is used to call clk_put() memory
managed clock. In clk.c the same name, in a different scope is used to call
clk_unregister().

As it stands, it is not really a problem but it does not readability,
especially if we need to call clk_put() on managed clock in clk.c
Signed-off-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Link: https://lore.kernel.org/r/20201021162147.563655-2-jbrunet@baylibre.comTested-by: default avatarKevin Hilman <khilman@baylibre.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 3650b228
...@@ -4068,12 +4068,12 @@ void clk_hw_unregister(struct clk_hw *hw) ...@@ -4068,12 +4068,12 @@ void clk_hw_unregister(struct clk_hw *hw)
} }
EXPORT_SYMBOL_GPL(clk_hw_unregister); EXPORT_SYMBOL_GPL(clk_hw_unregister);
static void devm_clk_release(struct device *dev, void *res) static void devm_clk_unregister_cb(struct device *dev, void *res)
{ {
clk_unregister(*(struct clk **)res); clk_unregister(*(struct clk **)res);
} }
static void devm_clk_hw_release(struct device *dev, void *res) static void devm_clk_hw_unregister_cb(struct device *dev, void *res)
{ {
clk_hw_unregister(*(struct clk_hw **)res); clk_hw_unregister(*(struct clk_hw **)res);
} }
...@@ -4093,7 +4093,7 @@ struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw) ...@@ -4093,7 +4093,7 @@ struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw)
struct clk *clk; struct clk *clk;
struct clk **clkp; struct clk **clkp;
clkp = devres_alloc(devm_clk_release, sizeof(*clkp), GFP_KERNEL); clkp = devres_alloc(devm_clk_unregister_cb, sizeof(*clkp), GFP_KERNEL);
if (!clkp) if (!clkp)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -4123,7 +4123,7 @@ int devm_clk_hw_register(struct device *dev, struct clk_hw *hw) ...@@ -4123,7 +4123,7 @@ int devm_clk_hw_register(struct device *dev, struct clk_hw *hw)
struct clk_hw **hwp; struct clk_hw **hwp;
int ret; int ret;
hwp = devres_alloc(devm_clk_hw_release, sizeof(*hwp), GFP_KERNEL); hwp = devres_alloc(devm_clk_hw_unregister_cb, sizeof(*hwp), GFP_KERNEL);
if (!hwp) if (!hwp)
return -ENOMEM; return -ENOMEM;
...@@ -4167,7 +4167,7 @@ static int devm_clk_hw_match(struct device *dev, void *res, void *data) ...@@ -4167,7 +4167,7 @@ static int devm_clk_hw_match(struct device *dev, void *res, void *data)
*/ */
void devm_clk_unregister(struct device *dev, struct clk *clk) void devm_clk_unregister(struct device *dev, struct clk *clk)
{ {
WARN_ON(devres_release(dev, devm_clk_release, devm_clk_match, clk)); WARN_ON(devres_release(dev, devm_clk_unregister_cb, devm_clk_match, clk));
} }
EXPORT_SYMBOL_GPL(devm_clk_unregister); EXPORT_SYMBOL_GPL(devm_clk_unregister);
...@@ -4182,7 +4182,7 @@ EXPORT_SYMBOL_GPL(devm_clk_unregister); ...@@ -4182,7 +4182,7 @@ EXPORT_SYMBOL_GPL(devm_clk_unregister);
*/ */
void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw) void devm_clk_hw_unregister(struct device *dev, struct clk_hw *hw)
{ {
WARN_ON(devres_release(dev, devm_clk_hw_release, devm_clk_hw_match, WARN_ON(devres_release(dev, devm_clk_hw_unregister_cb, devm_clk_hw_match,
hw)); hw));
} }
EXPORT_SYMBOL_GPL(devm_clk_hw_unregister); EXPORT_SYMBOL_GPL(devm_clk_hw_unregister);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment