Thread (5 messages) 5 messages, 2 authors, 2021-05-07

Re: [PATCH] TTY: serdev: Replace depricated macros

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-05-06 17:39:51
Also in: lkml

On Thu, May 06, 2021 at 08:32:28PM +0200, Ivan Bakula wrote:
quoted hunk ↗ jump to hunk
Replace depricated macros ida_simple_get and ida_simple_remove with
appropriate function calls to ida_alloc and ida_free.

Signed-off-by: Ivan Bakula <redacted>
---
 drivers/tty/serdev/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index aead0c0c9..5f873960b 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -75,7 +75,7 @@ static bool is_serdev_device(const struct device *dev)
 static void serdev_ctrl_release(struct device *dev)
 {
 	struct serdev_controller *ctrl = to_serdev_controller(dev);
-	ida_simple_remove(&ctrl_ida, ctrl->nr);
+	ida_free(&ctrl_ida, ctrl->nr);
 	kfree(ctrl);
 }
 
@@ -488,7 +488,7 @@ struct serdev_controller *serdev_controller_alloc(struct device *parent,
 	if (!ctrl)
 		return NULL;
 
-	id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL);
+	id = ida_alloc(&ctrl_ida, GFP_KERNEL);
 	if (id < 0) {
 		dev_err(parent,
 			"unable to allocate serdev controller identifier.\n");
-- 
2.31.1
If these really are "deprecated", why not just do a search/replace
across the whole tree and change them?  Or if not, what is wrong with
the existing ones?

Why shouldn't we be using the old calls?  What is wrong with them?

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help