/* We enforce only one user at a time here with the open/close. Also clear the previous interrupt data on an open, and clean up things on a close.  */
static int rtc_open(struct inode *inode, struct file *file)
/* We enforce only one user at a time here with the open/close. Also clear the previous interrupt data on an open, and clean up things on a close.  */
static int rtc_open(struct inode *inode, struct file *file)
{
	spin_lock_irq(&rtc_lock);
	if (rtc_status & RTC_IS_OPEN)
		goto out_busy;
	rtc_status |= RTC_IS_OPEN;
	rtc_irq_data = 0;
	spin_unlock_irq(&rtc_lock);
	return 0;
out_busy:
	spin_unlock_irq(&rtc_lock);
	return -EBUSY;
}