int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg) { #ifndef RTC_IRQ return -EIO; #else spin_lock_irq(&rtc_task_lock); if (rtc_callback != task) { spin_unlock_irq(&rtc_task_lock); return -ENXIO; } spin_unlock_irq(&rtc_task_lock); return rtc_do_ioctl(cmd, arg, 1); #endif }
int rtc_control(rtc_task_t *task, unsigned int cmd, unsigned long arg) { #ifndef RTC_IRQ return -EIO; #else unsigned long flags; if (cmd != RTC_PIE_ON && cmd != RTC_PIE_OFF && cmd != RTC_IRQP_SET) return -EINVAL; spin_lock_irqsave(&rtc_task_lock, flags); if (rtc_callback != task) { spin_unlock_irqrestore(&rtc_task_lock, flags); return -ENXIO; } spin_unlock_irqrestore(&rtc_task_lock, flags); return rtc_do_ioctl(cmd, arg, 1); #endif }
static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { return rtc_do_ioctl(cmd, arg, 0); }
static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { long ret; ret = rtc_do_ioctl(cmd, arg); return ret; }