diff mbox

[BUGFIX] rtc: eliminate extra call of ida_simple_remove()

Message ID 1354721131-31177-1-git-send-email-LW@KARO-electronics.de
State Rejected
Headers show

Commit Message

Lothar Waßmann Dec. 5, 2012, 3:25 p.m. UTC
Unbinding an RTC chip driver from its device leads to the error
message:
|ida_remove called for id=0 which is not allocated.

This is caused by a redundant call to ida_simple_remove() in
rtc_device_unregister().
Eliminate the call in rtc_device_unregister() and only call the
function in rtc_device_release().

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/rtc/class.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Comments

Alexander Holler Dec. 6, 2012, 3:17 p.m. UTC | #1
Am 05.12.2012 16:25, schrieb Lothar Waßmann:
> Unbinding an RTC chip driver from its device leads to the error
> message:
> |ida_remove called for id=0 which is not allocated.
>
> This is caused by a redundant call to ida_simple_remove() in
> rtc_device_unregister().
> Eliminate the call in rtc_device_unregister() and only call the
> function in rtc_device_release().
>
> Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>

I've just discovered the same problem. Although I've removed the call to
ida_simple_remove() in rtc_device_release() (for symmetry of 
register/unregister) I can offer a

Signed-off-by: Alexander Holler

A

Cc: <stable@vger.kernel.org>

might make sense, but it should just remove a warning, so I don't know 
if that qualifies for the stable series.

Regards,

Alexander
diff mbox

Patch

diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index f8a0aab..5143629 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -244,7 +244,6 @@  void rtc_device_unregister(struct rtc_device *rtc)
 		rtc_proc_del_device(rtc);
 		device_unregister(&rtc->dev);
 		rtc->ops = NULL;
-		ida_simple_remove(&rtc_ida, rtc->id);
 		mutex_unlock(&rtc->ops_lock);
 		put_device(&rtc->dev);
 	}