Skip to contentSkip to conversation

staging: fieldbus: Directly use ida_alloc()/free()

PATCH In review keliu 2 participants 2 messages May 27, 2022 – Jun 1, 2022 Staging

lore
Share & tools
lore

keliu

author
#0 lore raw

PATCH 1/1 staging: fieldbus: Directly use ida_alloc()/free()

Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .

---
 drivers/staging/fieldbus/anybuss/arcx-anybus.c | 6 +++---
 drivers/staging/fieldbus/dev_core.c            | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/fieldbus/anybuss/arcx-anybus.c +3 -3
index 9af2e63050d1..381d710aa6ce 100644
@@ -282,7 +282,7 @@ static int controller_probe(struct platform_device *pdev)
 		}
 	}
 
-	id = ida_simple_get(&controller_index_ida, 0, 0, GFP_KERNEL);
+	id = ida_alloc(&controller_index_ida, GFP_KERNEL);
 	if (id < 0) {
 		err = id;
 		goto out_reset;
@@ -315,7 +315,7 @@ static int controller_probe(struct platform_device *pdev)
 out_dev:
 	put_device(cd->class_dev);
 out_ida:
-	ida_simple_remove(&controller_index_ida, id);
+	ida_free(&controller_index_ida, id);
 out_reset:
 	gpiod_set_value_cansleep(cd->reset_gpiod, 1);
 	return err;
@@ -327,7 +327,7 @@ static int controller_remove(struct platform_device *pdev)
 	int id = cd->class_dev->id;
 
 	device_unregister(cd->class_dev);
-	ida_simple_remove(&controller_index_ida, id);
+	ida_free(&controller_index_ida, id);
 	gpiod_set_value_cansleep(cd->reset_gpiod, 1);
 	return 0;
 }
drivers/staging/fieldbus/dev_core.c +2 -2
index 5aab734606ea..b5e55890001e 100644
@@ -251,7 +251,7 @@ static void __fieldbus_dev_unregister(struct fieldbus_dev *fb)
 		return;
 	device_destroy(&fieldbus_class, fb->cdev.dev);
 	cdev_del(&fb->cdev);
-	ida_simple_remove(&fieldbus_ida, fb->id);
+	ida_free(&fieldbus_ida, fb->id);
 }
 
 void fieldbus_dev_unregister(struct fieldbus_dev *fb)
@@ -294,7 +294,7 @@ static int __fieldbus_dev_register(struct fieldbus_dev *fb)
 err_dev_create:
 	cdev_del(&fb->cdev);
 err_cdev:
-	ida_simple_remove(&fieldbus_ida, fb->id);
+	ida_free(&fieldbus_ida, fb->id);
 	return err;
 }
 
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 8 lines · keliu

Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .

---
 drivers/staging/fieldbus/anybuss/arcx-anybus.c | 6 +++---
 drivers/staging/fieldbus/dev_core.c            | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

As my bot said, you need to properly document and fix up your author name on all of these patches. I'll drop them all from my patch queue, please fix up and actually test-build your changes before sending them out again.

thanks,

greg k-h