projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b09d633
)
rtc: Directly use ida_alloc()/free()
author
keliu
<liuke94@huawei.com>
Fri, 27 May 2022 07:36:36 +0000
(07:36 +0000)
committer
Alexandre Belloni
<alexandre.belloni@bootlin.com>
Fri, 24 Jun 2022 19:44:53 +0000
(21:44 +0200)
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
drivers/rtc/class.c
patch
|
blob
|
history
diff --git
a/drivers/rtc/class.c
b/drivers/rtc/class.c
index 3c8eec2218dfb478be5b3981a9a183a4708f4f99..e48223c00c672eb37aa0132f319e52765c7ded02 100644
(file)
--- 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_remov
e(&rtc_ida, rtc->id);
+ ida_
fre
e(&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_remov
e(&rtc_ida, id);
+ ida_
fre
e(&rtc_ida, id);
return ERR_PTR(-ENOMEM);
}