mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 21:30:43 +00:00
rtc: don't return -EBUSY when mutex_lock_interruptible() fails
It was pointed out that the RTC framework handles its mutex locks oddly ... returning -EBUSY when interrupted. This fixes that by returning the value of mutex_lock_interruptible() (i.e. -EINTR). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
950d442ad0
commit
b68bb26324
@ -20,7 +20,7 @@ int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm)
|
||||
|
||||
err = mutex_lock_interruptible(&rtc->ops_lock);
|
||||
if (err)
|
||||
return -EBUSY;
|
||||
return err;
|
||||
|
||||
if (!rtc->ops)
|
||||
err = -ENODEV;
|
||||
@ -46,7 +46,7 @@ int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
|
||||
|
||||
err = mutex_lock_interruptible(&rtc->ops_lock);
|
||||
if (err)
|
||||
return -EBUSY;
|
||||
return err;
|
||||
|
||||
if (!rtc->ops)
|
||||
err = -ENODEV;
|
||||
@ -66,7 +66,7 @@ int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs)
|
||||
|
||||
err = mutex_lock_interruptible(&rtc->ops_lock);
|
||||
if (err)
|
||||
return -EBUSY;
|
||||
return err;
|
||||
|
||||
if (!rtc->ops)
|
||||
err = -ENODEV;
|
||||
@ -106,7 +106,7 @@ static int rtc_read_alarm_internal(struct rtc_device *rtc, struct rtc_wkalrm *al
|
||||
|
||||
err = mutex_lock_interruptible(&rtc->ops_lock);
|
||||
if (err)
|
||||
return -EBUSY;
|
||||
return err;
|
||||
|
||||
if (rtc->ops == NULL)
|
||||
err = -ENODEV;
|
||||
@ -293,7 +293,7 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
|
||||
|
||||
err = mutex_lock_interruptible(&rtc->ops_lock);
|
||||
if (err)
|
||||
return -EBUSY;
|
||||
return err;
|
||||
|
||||
if (!rtc->ops)
|
||||
err = -ENODEV;
|
||||
|
@ -221,7 +221,7 @@ static long rtc_dev_ioctl(struct file *file,
|
||||
|
||||
err = mutex_lock_interruptible(&rtc->ops_lock);
|
||||
if (err)
|
||||
return -EBUSY;
|
||||
return err;
|
||||
|
||||
/* check that the calling task has appropriate permissions
|
||||
* for certain ioctls. doing this check here is useful
|
||||
|
Loading…
Reference in New Issue
Block a user