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

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>

authored by

Uwe Kleine-König and committed by
Uwe Kleine-König
f0d91b16 62df4991

-8
-8
drivers/pwm/pwm-clps711x.c
··· 14 14 struct clps711x_chip { 15 15 void __iomem *pmpcon; 16 16 struct clk *clk; 17 - spinlock_t lock; 18 17 }; 19 18 20 19 static inline struct clps711x_chip *to_clps711x_chip(struct pwm_chip *chip) ··· 41 42 struct clps711x_chip *priv = to_clps711x_chip(chip); 42 43 /* PWM0 - bits 4..7, PWM1 - bits 8..11 */ 43 44 u32 shift = (pwm->hwpwm + 1) * 4; 44 - unsigned long flags; 45 45 u32 pmpcon, val; 46 46 47 47 if (state->polarity != PWM_POLARITY_NORMAL) ··· 54 56 else 55 57 val = 0; 56 58 57 - spin_lock_irqsave(&priv->lock, flags); 58 - 59 59 pmpcon = readl(priv->pmpcon); 60 60 pmpcon &= ~(0xf << shift); 61 61 pmpcon |= val << shift; 62 62 writel(pmpcon, priv->pmpcon); 63 - 64 - spin_unlock_irqrestore(&priv->lock, flags); 65 63 66 64 return 0; 67 65 } ··· 86 92 return PTR_ERR(priv->clk); 87 93 88 94 chip->ops = &clps711x_pwm_ops; 89 - 90 - spin_lock_init(&priv->lock); 91 95 92 96 return devm_pwmchip_add(&pdev->dev, chip); 93 97 }