rtc: recycle id when unloading a rtc driver
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / rtc / class.c
index dc4c274..37b1d82 100644 (file)
@@ -238,6 +238,7 @@ 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);
        }