Skip to content

Commit f0d91b1

Browse files
ukleinekUwe Kleine-König
authored andcommitted
pwm: clps711x: Drop driver local locking
The pwm core serializes calls to .apply(), so the spinlock adds no additional protection. Disabling the irq is also irrelevant as the driver isn't an atomic one and so the callbacks cannot be called from atomic context. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/d4931dc0c0d657d80722cfe7d97cb4fb4ccec90e.1750788649.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 62df499 commit f0d91b1

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

drivers/pwm/pwm-clps711x.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
struct clps711x_chip {
1515
void __iomem *pmpcon;
1616
struct clk *clk;
17-
spinlock_t lock;
1817
};
1918

2019
static inline struct clps711x_chip *to_clps711x_chip(struct pwm_chip *chip)
@@ -42,7 +41,6 @@ static int clps711x_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
4241
struct clps711x_chip *priv = to_clps711x_chip(chip);
4342
/* PWM0 - bits 4..7, PWM1 - bits 8..11 */
4443
u32 shift = (pwm->hwpwm + 1) * 4;
45-
unsigned long flags;
4644
u32 pmpcon, val;
4745

4846
if (state->polarity != PWM_POLARITY_NORMAL)
@@ -56,15 +54,11 @@ static int clps711x_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
5654
else
5755
val = 0;
5856

59-
spin_lock_irqsave(&priv->lock, flags);
60-
6157
pmpcon = readl(priv->pmpcon);
6258
pmpcon &= ~(0xf << shift);
6359
pmpcon |= val << shift;
6460
writel(pmpcon, priv->pmpcon);
6561

66-
spin_unlock_irqrestore(&priv->lock, flags);
67-
6862
return 0;
6963
}
7064

@@ -93,8 +87,6 @@ static int clps711x_pwm_probe(struct platform_device *pdev)
9387

9488
chip->ops = &clps711x_pwm_ops;
9589

96-
spin_lock_init(&priv->lock);
97-
9890
return devm_pwmchip_add(&pdev->dev, chip);
9991
}
10092

0 commit comments

Comments
 (0)