From 5b4ee6d1e13d0b9df70fc437f50251ff1c034524 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 14 Jan 2024 11:10:15 +0100 Subject: staging: fieldbus: Remove usage of the deprecated ida_simple_xx() API ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/d305b97b1064ba7e026232fb8c2a0783ba1b1098.1705227001.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fieldbus/anybuss/arcx-anybus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/fieldbus/anybuss/arcx-anybus.c') diff --git a/drivers/staging/fieldbus/anybuss/arcx-anybus.c b/drivers/staging/fieldbus/anybuss/arcx-anybus.c index 34d18b09bedd..fcd3e3722ae0 100644 --- a/drivers/staging/fieldbus/anybuss/arcx-anybus.c +++ b/drivers/staging/fieldbus/anybuss/arcx-anybus.c @@ -285,7 +285,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; @@ -318,7 +318,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; @@ -330,7 +330,7 @@ static void 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); } -- cgit v1.2.3