diff options
Diffstat (limited to 'drivers/misc/cs5535-mfgpt.c')
-rw-r--r-- | drivers/misc/cs5535-mfgpt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c index 2d44b3300104..6f6218061b0d 100644 --- a/drivers/misc/cs5535-mfgpt.c +++ b/drivers/misc/cs5535-mfgpt.c | |||
@@ -211,6 +211,17 @@ EXPORT_SYMBOL_GPL(cs5535_mfgpt_alloc_timer); | |||
211 | */ | 211 | */ |
212 | void cs5535_mfgpt_free_timer(struct cs5535_mfgpt_timer *timer) | 212 | void cs5535_mfgpt_free_timer(struct cs5535_mfgpt_timer *timer) |
213 | { | 213 | { |
214 | unsigned long flags; | ||
215 | uint16_t val; | ||
216 | |||
217 | /* timer can be made available again only if never set up */ | ||
218 | val = cs5535_mfgpt_read(timer, MFGPT_REG_SETUP); | ||
219 | if (!(val & MFGPT_SETUP_SETUP)) { | ||
220 | spin_lock_irqsave(&timer->chip->lock, flags); | ||
221 | __set_bit(timer->nr, timer->chip->avail); | ||
222 | spin_unlock_irqrestore(&timer->chip->lock, flags); | ||
223 | } | ||
224 | |||
214 | kfree(timer); | 225 | kfree(timer); |
215 | } | 226 | } |
216 | EXPORT_SYMBOL_GPL(cs5535_mfgpt_free_timer); | 227 | EXPORT_SYMBOL_GPL(cs5535_mfgpt_free_timer); |