aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/interface.c
diff options
context:
space:
mode:
authorChris Brand <chris.brand@broadcom.com>2013-07-03 18:07:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:08:00 -0400
commit0734e27f0befe9e88c2b5dad789b05b7bf86ce90 (patch)
tree2fc9329ef599d4b91dd8d05fd58d3f66f2106fd4 /drivers/rtc/interface.c
parent5ee67484dede220d96c0b323c78d02c63fdfae44 (diff)
drivers/rtc/interface.c: return -EBUSY, not -EACCES when device is busy
If rtc->irq_task is non-NULL and task is NULL, they always rtc_irq_set_freq(), whenever err is set to -EBUSY it will then immediately be set to -EACCES, misleading the caller as to the underlying problem. Signed-off-by: Chris Brand <chris.brand@broadcom.com> 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>
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r--drivers/rtc/interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 14c1efdd0757..72c5cdbe0791 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -698,9 +698,9 @@ retry:
698 spin_lock_irqsave(&rtc->irq_task_lock, flags); 698 spin_lock_irqsave(&rtc->irq_task_lock, flags);
699 if (rtc->irq_task != NULL && task == NULL) 699 if (rtc->irq_task != NULL && task == NULL)
700 err = -EBUSY; 700 err = -EBUSY;
701 if (rtc->irq_task != task) 701 else if (rtc->irq_task != task)
702 err = -EACCES; 702 err = -EACCES;
703 if (!err) { 703 else {
704 if (rtc_update_hrtimer(rtc, enabled) < 0) { 704 if (rtc_update_hrtimer(rtc, enabled) < 0) {
705 spin_unlock_irqrestore(&rtc->irq_task_lock, flags); 705 spin_unlock_irqrestore(&rtc->irq_task_lock, flags);
706 cpu_relax(); 706 cpu_relax();
@@ -734,9 +734,9 @@ retry:
734 spin_lock_irqsave(&rtc->irq_task_lock, flags); 734 spin_lock_irqsave(&rtc->irq_task_lock, flags);
735 if (rtc->irq_task != NULL && task == NULL) 735 if (rtc->irq_task != NULL && task == NULL)
736 err = -EBUSY; 736 err = -EBUSY;
737 if (rtc->irq_task != task) 737 else if (rtc->irq_task != task)
738 err = -EACCES; 738 err = -EACCES;
739 if (!err) { 739 else {
740 rtc->irq_freq = freq; 740 rtc->irq_freq = freq;
741 if (rtc->pie_enabled && rtc_update_hrtimer(rtc, 1) < 0) { 741 if (rtc->pie_enabled && rtc_update_hrtimer(rtc, 1) < 0) {
742 spin_unlock_irqrestore(&rtc->irq_task_lock, flags); 742 spin_unlock_irqrestore(&rtc->irq_task_lock, flags);