diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-03-10 14:47:20 +0100 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2024-04-30 18:57:08 +0200 |
commit | 141a8502214df0b114a81d60d2cd613c52c02b0f (patch) | |
tree | 38cb6d166d0dbde600ea471fdce0ff5c7535d1dd /drivers/pwm | |
parent | 664d8dbb54671564196e08c76d4c7c063eacb14b (diff) | |
download | linux-141a8502214df0b114a81d60d2cd613c52c02b0f.tar.gz linux-141a8502214df0b114a81d60d2cd613c52c02b0f.tar.bz2 linux-141a8502214df0b114a81d60d2cd613c52c02b0f.zip |
pwm: bcm2835: Drop open coded variant of devm_clk_rate_exclusive_get()
Since commit b0cde62e4c54 ("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: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/8e1a5151a7bcd455996c873bb3d13ab86def3490.1710078146.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'drivers/pwm')
-rw-r--r-- | drivers/pwm/pwm-bcm2835.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c index 3d0c089c9ef0..578e95e0296c 100644 --- a/drivers/pwm/pwm-bcm2835.c +++ b/drivers/pwm/pwm-bcm2835.c @@ -124,13 +124,6 @@ static const struct pwm_ops bcm2835_pwm_ops = { .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) { struct device *dev = &pdev->dev; @@ -152,16 +145,11 @@ static int bcm2835_pwm_probe(struct platform_device *pdev) return dev_err_probe(dev, PTR_ERR(pc->clk), "clock not found\n"); - ret = clk_rate_exclusive_get(pc->clk); + ret = devm_clk_rate_exclusive_get(dev, pc->clk); if (ret) return dev_err_probe(dev, ret, "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); if (!pc->rate) return dev_err_probe(dev, -EINVAL, |