Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+1 -13
+1 -13
drivers/pwm/pwm-bcm2835.c
··· 124 124 .apply = bcm2835_pwm_apply, 125 125 }; 126 126 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 - 134 127 static int bcm2835_pwm_probe(struct platform_device *pdev) 135 128 { 136 129 struct device *dev = &pdev->dev; ··· 145 152 return dev_err_probe(dev, PTR_ERR(pc->clk), 146 153 "clock not found\n"); 147 154 148 - ret = clk_rate_exclusive_get(pc->clk); 155 + ret = devm_clk_rate_exclusive_get(dev, pc->clk); 149 156 if (ret) 150 157 return dev_err_probe(dev, ret, 151 158 "fail to get exclusive rate\n"); 152 - 153 - ret = devm_add_action_or_reset(dev, devm_clk_rate_exclusive_put, 154 - pc->clk); 155 - if (ret) 156 - return ret; 157 159 158 160 pc->rate = clk_get_rate(pc->clk); 159 161 if (!pc->rate)