aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r--drivers/rtc/interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index de0da545c7a1..a4f56e95cf96 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -293,7 +293,7 @@ int rtc_irq_register(struct rtc_device *rtc, struct rtc_task *task)
293 return -EINVAL; 293 return -EINVAL;
294 294
295 /* Cannot register while the char dev is in use */ 295 /* Cannot register while the char dev is in use */
296 if (!(mutex_trylock(&rtc->char_lock))) 296 if (test_and_set_bit(RTC_DEV_BUSY, &rtc->flags))
297 return -EBUSY; 297 return -EBUSY;
298 298
299 spin_lock_irq(&rtc->irq_task_lock); 299 spin_lock_irq(&rtc->irq_task_lock);
@@ -303,7 +303,7 @@ int rtc_irq_register(struct rtc_device *rtc, struct rtc_task *task)
303 } 303 }
304 spin_unlock_irq(&rtc->irq_task_lock); 304 spin_unlock_irq(&rtc->irq_task_lock);
305 305
306 mutex_unlock(&rtc->char_lock); 306 clear_bit(RTC_DEV_BUSY, &rtc->flags);
307 307
308 return retval; 308 return retval;
309} 309}