Skip to content

Commit 0d6bc3e

Browse files
Uwe Kleine-Königthierryreding
authored andcommitted
pwm: brcmstb: Remove useless locking
The lock only protects against concurrent users of the PWM API. This is not expected to be necessary. And if there was such an issue, this is better handled in the PWM core instead as it affects all drivers in the same way. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
1 parent 0dcfafe commit 0d6bc3e

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

drivers/pwm/pwm-brcmstb.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353

5454
struct brcmstb_pwm {
5555
void __iomem *base;
56-
spinlock_t lock;
5756
struct clk *clk;
5857
struct pwm_chip chip;
5958
};
@@ -159,7 +158,6 @@ static int brcmstb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
159158
* generator output a base frequency for the constant frequency
160159
* generator to derive from.
161160
*/
162-
spin_lock(&p->lock);
163161
brcmstb_pwm_writel(p, cword >> 8, PWM_CWORD_MSB(channel));
164162
brcmstb_pwm_writel(p, cword & 0xff, PWM_CWORD_LSB(channel));
165163

@@ -171,7 +169,6 @@ static int brcmstb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
171169
/* Configure on and period value */
172170
brcmstb_pwm_writel(p, pc, PWM_PERIOD(channel));
173171
brcmstb_pwm_writel(p, dc, PWM_ON(channel));
174-
spin_unlock(&p->lock);
175172

176173
return 0;
177174
}
@@ -182,7 +179,6 @@ static inline void brcmstb_pwm_enable_set(struct brcmstb_pwm *p,
182179
unsigned int shift = channel * CTRL_CHAN_OFFS;
183180
u32 value;
184181

185-
spin_lock(&p->lock);
186182
value = brcmstb_pwm_readl(p, PWM_CTRL);
187183

188184
if (enable) {
@@ -194,7 +190,6 @@ static inline void brcmstb_pwm_enable_set(struct brcmstb_pwm *p,
194190
}
195191

196192
brcmstb_pwm_writel(p, value, PWM_CTRL);
197-
spin_unlock(&p->lock);
198193
}
199194

200195
static int brcmstb_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
@@ -243,8 +238,6 @@ static int brcmstb_pwm_probe(struct platform_device *pdev)
243238
if (!p)
244239
return -ENOMEM;
245240

246-
spin_lock_init(&p->lock);
247-
248241
p->clk = devm_clk_get(&pdev->dev, NULL);
249242
if (IS_ERR(p->clk)) {
250243
dev_err(&pdev->dev, "failed to obtain clock\n");

0 commit comments

Comments
 (0)