RTC: convert mutex to bitfield
[pandora-kernel.git] / drivers / rtc / interface.c
index de0da54..a4f56e9 100644 (file)
@@ -293,7 +293,7 @@ int rtc_irq_register(struct rtc_device *rtc, struct rtc_task *task)
                return -EINVAL;
 
        /* Cannot register while the char dev is in use */
-       if (!(mutex_trylock(&rtc->char_lock)))
+       if (test_and_set_bit(RTC_DEV_BUSY, &rtc->flags))
                return -EBUSY;
 
        spin_lock_irq(&rtc->irq_task_lock);
@@ -303,7 +303,7 @@ int rtc_irq_register(struct rtc_device *rtc, struct rtc_task *task)
        }
        spin_unlock_irq(&rtc->irq_task_lock);
 
-       mutex_unlock(&rtc->char_lock);
+       clear_bit(RTC_DEV_BUSY, &rtc->flags);
 
        return retval;
 }