Commit 141a8502 authored by Uwe Kleine-König's avatar Uwe Kleine-König

pwm: bcm2835: Drop open coded variant of devm_clk_rate_exclusive_get()

Since commit b0cde62e ("clk: Add a devm variant of
clk_rate_exclusive_get()") the clk subsystem provides
devm_clk_rate_exclusive_get(). Replace the open coded implementation by
the new function.
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/8e1a5151a7bcd455996c873bb3d13ab86def3490.1710078146.git.u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 664d8dbb
...@@ -124,13 +124,6 @@ static const struct pwm_ops bcm2835_pwm_ops = { ...@@ -124,13 +124,6 @@ static const struct pwm_ops bcm2835_pwm_ops = {
.apply = bcm2835_pwm_apply, .apply = bcm2835_pwm_apply,
}; };
static void devm_clk_rate_exclusive_put(void *data)
{
struct clk *clk = data;
clk_rate_exclusive_put(clk);
}
static int bcm2835_pwm_probe(struct platform_device *pdev) static int bcm2835_pwm_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -152,16 +145,11 @@ static int bcm2835_pwm_probe(struct platform_device *pdev) ...@@ -152,16 +145,11 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(pc->clk), return dev_err_probe(dev, PTR_ERR(pc->clk),
"clock not found\n"); "clock not found\n");
ret = clk_rate_exclusive_get(pc->clk); ret = devm_clk_rate_exclusive_get(dev, pc->clk);
if (ret) if (ret)
return dev_err_probe(dev, ret, return dev_err_probe(dev, ret,
"fail to get exclusive rate\n"); "fail to get exclusive rate\n");
ret = devm_add_action_or_reset(dev, devm_clk_rate_exclusive_put,
pc->clk);
if (ret)
return ret;
pc->rate = clk_get_rate(pc->clk); pc->rate = clk_get_rate(pc->clk);
if (!pc->rate) if (!pc->rate)
return dev_err_probe(dev, -EINVAL, return dev_err_probe(dev, -EINVAL,
......
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