Skip to content

Commit 62df499

Browse files
ukleinekUwe Kleine-König
authored andcommitted
pwm: atmel: Drop driver local locking
The two functions making use of the lock are only called transitively from .apply(). Calls to .apply() are already serialized by the pwm core so the lock in the driver has no effect and can safely be dropped. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/5ad3417aecd4dc6eca9699e21691e3725ea0bb87.1750788649.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 0191c80 commit 62df499

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

drivers/pwm/pwm-atmel.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ struct atmel_pwm_chip {
9191
* hardware.
9292
*/
9393
u32 update_pending;
94-
95-
/* Protects .update_pending */
96-
spinlock_t lock;
9794
};
9895

9996
static inline struct atmel_pwm_chip *to_atmel_pwm_chip(struct pwm_chip *chip)
@@ -145,34 +142,26 @@ static void atmel_pwm_update_pending(struct atmel_pwm_chip *chip)
145142

146143
static void atmel_pwm_set_pending(struct atmel_pwm_chip *chip, unsigned int ch)
147144
{
148-
spin_lock(&chip->lock);
149-
150145
/*
151146
* Clear pending flags in hardware because otherwise there might still
152147
* be a stale flag in ISR.
153148
*/
154149
atmel_pwm_update_pending(chip);
155150

156151
chip->update_pending |= (1 << ch);
157-
158-
spin_unlock(&chip->lock);
159152
}
160153

161154
static int atmel_pwm_test_pending(struct atmel_pwm_chip *chip, unsigned int ch)
162155
{
163156
int ret = 0;
164157

165-
spin_lock(&chip->lock);
166-
167158
if (chip->update_pending & (1 << ch)) {
168159
atmel_pwm_update_pending(chip);
169160

170161
if (chip->update_pending & (1 << ch))
171162
ret = 1;
172163
}
173164

174-
spin_unlock(&chip->lock);
175-
176165
return ret;
177166
}
178167

@@ -509,7 +498,6 @@ static int atmel_pwm_probe(struct platform_device *pdev)
509498
atmel_pwm->data = of_device_get_match_data(&pdev->dev);
510499

511500
atmel_pwm->update_pending = 0;
512-
spin_lock_init(&atmel_pwm->lock);
513501

514502
atmel_pwm->base = devm_platform_ioremap_resource(pdev, 0);
515503
if (IS_ERR(atmel_pwm->base))

0 commit comments

Comments
 (0)