Skip to content

Commit 141a850

Browse files
author
Uwe Kleine-König
committed
pwm: bcm2835: Drop open coded variant of devm_clk_rate_exclusive_get()
Since commit b0cde62 ("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 <[email protected]> Link: https://lore.kernel.org/r/8e1a5151a7bcd455996c873bb3d13ab86def3490.1710078146.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 664d8db commit 141a850

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

drivers/pwm/pwm-bcm2835.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ static const struct pwm_ops bcm2835_pwm_ops = {
124124
.apply = bcm2835_pwm_apply,
125125
};
126126

127-
static void devm_clk_rate_exclusive_put(void *data)
128-
{
129-
struct clk *clk = data;
130-
131-
clk_rate_exclusive_put(clk);
132-
}
133-
134127
static int bcm2835_pwm_probe(struct platform_device *pdev)
135128
{
136129
struct device *dev = &pdev->dev;
@@ -152,16 +145,11 @@ static int bcm2835_pwm_probe(struct platform_device *pdev)
152145
return dev_err_probe(dev, PTR_ERR(pc->clk),
153146
"clock not found\n");
154147

155-
ret = clk_rate_exclusive_get(pc->clk);
148+
ret = devm_clk_rate_exclusive_get(dev, pc->clk);
156149
if (ret)
157150
return dev_err_probe(dev, ret,
158151
"fail to get exclusive rate\n");
159152

160-
ret = devm_add_action_or_reset(dev, devm_clk_rate_exclusive_put,
161-
pc->clk);
162-
if (ret)
163-
return ret;
164-
165153
pc->rate = clk_get_rate(pc->clk);
166154
if (!pc->rate)
167155
return dev_err_probe(dev, -EINVAL,

0 commit comments

Comments
 (0)