Commit b68bb2632453a9ca7d10a00d79adf60968cb4c05
Committed by
Linus Torvalds
1 parent
950d442ad0
Exists in
master
and in
39 other branches
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>
Showing 2 changed files with 6 additions and 6 deletions Side-by-side Diff
drivers/rtc/interface.c
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | |
21 | 21 | err = mutex_lock_interruptible(&rtc->ops_lock); |
22 | 22 | if (err) |
23 | - return -EBUSY; | |
23 | + return err; | |
24 | 24 | |
25 | 25 | if (!rtc->ops) |
26 | 26 | err = -ENODEV; |
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | |
47 | 47 | err = mutex_lock_interruptible(&rtc->ops_lock); |
48 | 48 | if (err) |
49 | - return -EBUSY; | |
49 | + return err; | |
50 | 50 | |
51 | 51 | if (!rtc->ops) |
52 | 52 | err = -ENODEV; |
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | |
67 | 67 | err = mutex_lock_interruptible(&rtc->ops_lock); |
68 | 68 | if (err) |
69 | - return -EBUSY; | |
69 | + return err; | |
70 | 70 | |
71 | 71 | if (!rtc->ops) |
72 | 72 | err = -ENODEV; |
... | ... | @@ -106,7 +106,7 @@ |
106 | 106 | |
107 | 107 | err = mutex_lock_interruptible(&rtc->ops_lock); |
108 | 108 | if (err) |
109 | - return -EBUSY; | |
109 | + return err; | |
110 | 110 | |
111 | 111 | if (rtc->ops == NULL) |
112 | 112 | err = -ENODEV; |
... | ... | @@ -293,7 +293,7 @@ |
293 | 293 | |
294 | 294 | err = mutex_lock_interruptible(&rtc->ops_lock); |
295 | 295 | if (err) |
296 | - return -EBUSY; | |
296 | + return err; | |
297 | 297 | |
298 | 298 | if (!rtc->ops) |
299 | 299 | err = -ENODEV; |
drivers/rtc/rtc-dev.c