mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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 <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/d4931dc0c0d657d80722cfe7d97cb4fb4ccec90e.1750788649.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
This commit is contained in:
committed by
Uwe Kleine-König
parent
62df49917e
commit
f0d91b16dc
@@ -14,7 +14,6 @@
|
||||
struct clps711x_chip {
|
||||
void __iomem *pmpcon;
|
||||
struct clk *clk;
|
||||
spinlock_t lock;
|
||||
};
|
||||
|
||||
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,
|
||||
struct clps711x_chip *priv = to_clps711x_chip(chip);
|
||||
/* PWM0 - bits 4..7, PWM1 - bits 8..11 */
|
||||
u32 shift = (pwm->hwpwm + 1) * 4;
|
||||
unsigned long flags;
|
||||
u32 pmpcon, val;
|
||||
|
||||
if (state->polarity != PWM_POLARITY_NORMAL)
|
||||
@@ -56,15 +54,11 @@ static int clps711x_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||
else
|
||||
val = 0;
|
||||
|
||||
spin_lock_irqsave(&priv->lock, flags);
|
||||
|
||||
pmpcon = readl(priv->pmpcon);
|
||||
pmpcon &= ~(0xf << shift);
|
||||
pmpcon |= val << shift;
|
||||
writel(pmpcon, priv->pmpcon);
|
||||
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -93,8 +87,6 @@ static int clps711x_pwm_probe(struct platform_device *pdev)
|
||||
|
||||
chip->ops = &clps711x_pwm_ops;
|
||||
|
||||
spin_lock_init(&priv->lock);
|
||||
|
||||
return devm_pwmchip_add(&pdev->dev, chip);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user