summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorkeliu <liuke94@huawei.com>2022-05-27 10:36:36 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2022-06-24 22:44:53 +0300
commit592ff0c8d0648610511f4e4fb532f100168e6e0d (patch)
treed1a0936681af647de7b131bfbb9cc3c1377a701a /drivers/rtc
parentb09d633575e54e98e1362bd5c36cd9571cb71d8a (diff)
downloadlinux-592ff0c8d0648610511f4e4fb532f100168e6e0d.tar.xz
rtc: Directly use ida_alloc()/free()
Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu <liuke94@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20220527073636.2474546-1-liuke94@huawei.com
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/class.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 3c8eec2218df..e48223c00c67 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -36,7 +36,7 @@ static void rtc_device_release(struct device *dev)
cancel_work_sync(&rtc->irqwork);
- ida_simple_remove(&rtc_ida, rtc->id);
+ ida_free(&rtc_ida, rtc->id);
mutex_destroy(&rtc->ops_lock);
kfree(rtc);
}
@@ -262,7 +262,7 @@ static int rtc_device_get_id(struct device *dev)
}
if (id < 0)
- id = ida_simple_get(&rtc_ida, 0, 0, GFP_KERNEL);
+ id = ida_alloc(&rtc_ida, GFP_KERNEL);
return id;
}
@@ -368,7 +368,7 @@ struct rtc_device *devm_rtc_allocate_device(struct device *dev)
rtc = rtc_allocate_device();
if (!rtc) {
- ida_simple_remove(&rtc_ida, id);
+ ida_free(&rtc_ida, id);
return ERR_PTR(-ENOMEM);
}