* [PATCH] drivers: slimbus: Directly use ida_alloc()/free()
@ 2022-05-27 7:30 keliu
2022-06-06 10:10 ` Srinivas Kandagatla
0 siblings, 1 reply; 2+ messages in thread
From: keliu @ 2022-05-27 7:30 UTC (permalink / raw)
To: srinivas.kandagatla, alsa-devel, linux-kernel; +Cc: keliu
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .
Signed-off-by: keliu <liuke94@huawei.com>
---
drivers/slimbus/core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
index 78480e332ab8..219483b79c09 100644
--- a/drivers/slimbus/core.c
+++ b/drivers/slimbus/core.c
@@ -250,7 +250,7 @@ int slim_register_controller(struct slim_controller *ctrl)
{
int id;
- id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL);
+ id = ida_alloc(&ctrl_ida, GFP_KERNEL);
if (id < 0)
return id;
@@ -299,7 +299,7 @@ int slim_unregister_controller(struct slim_controller *ctrl)
{
/* Remove all clients */
device_for_each_child(ctrl->dev, NULL, slim_ctrl_remove_device);
- ida_simple_remove(&ctrl_ida, ctrl->id);
+ ida_free(&ctrl_ida, ctrl->id);
return 0;
}
@@ -323,7 +323,7 @@ void slim_report_absent(struct slim_device *sbdev)
sbdev->is_laddr_valid = false;
mutex_unlock(&ctrl->lock);
if (!ctrl->get_laddr)
- ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr);
+ ida_free(&ctrl->laddr_ida, sbdev->laddr);
slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN);
}
EXPORT_SYMBOL_GPL(slim_report_absent);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers: slimbus: Directly use ida_alloc()/free()
2022-05-27 7:30 [PATCH] drivers: slimbus: Directly use ida_alloc()/free() keliu
@ 2022-06-06 10:10 ` Srinivas Kandagatla
0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Kandagatla @ 2022-06-06 10:10 UTC (permalink / raw)
To: keliu, alsa-devel, linux-kernel
On 27/05/2022 08:30, keliu wrote:
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
>
> Signed-off-by: keliu <liuke94@huawei.com>
Applied thanks,
--srini
> ---
> drivers/slimbus/core.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c
> index 78480e332ab8..219483b79c09 100644
> --- a/drivers/slimbus/core.c
> +++ b/drivers/slimbus/core.c
> @@ -250,7 +250,7 @@ int slim_register_controller(struct slim_controller *ctrl)
> {
> int id;
>
> - id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL);
> + id = ida_alloc(&ctrl_ida, GFP_KERNEL);
> if (id < 0)
> return id;
>
> @@ -299,7 +299,7 @@ int slim_unregister_controller(struct slim_controller *ctrl)
> {
> /* Remove all clients */
> device_for_each_child(ctrl->dev, NULL, slim_ctrl_remove_device);
> - ida_simple_remove(&ctrl_ida, ctrl->id);
> + ida_free(&ctrl_ida, ctrl->id);
>
> return 0;
> }
> @@ -323,7 +323,7 @@ void slim_report_absent(struct slim_device *sbdev)
> sbdev->is_laddr_valid = false;
> mutex_unlock(&ctrl->lock);
> if (!ctrl->get_laddr)
> - ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr);
> + ida_free(&ctrl->laddr_ida, sbdev->laddr);
> slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN);
> }
> EXPORT_SYMBOL_GPL(slim_report_absent);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-06 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 7:30 [PATCH] drivers: slimbus: Directly use ida_alloc()/free() keliu
2022-06-06 10:10 ` Srinivas Kandagatla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).