Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: slimbus: Directly use ida_alloc()/free()

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

Signed-off-by: keliu <liuke94@huawei.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220706101131.6934-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

keliu and committed by
Greg Kroah-Hartman
ad804659 ff46a601

+3 -3
+3 -3
drivers/slimbus/core.c
··· 250 250 { 251 251 int id; 252 252 253 - id = ida_simple_get(&ctrl_ida, 0, 0, GFP_KERNEL); 253 + id = ida_alloc(&ctrl_ida, GFP_KERNEL); 254 254 if (id < 0) 255 255 return id; 256 256 ··· 299 299 { 300 300 /* Remove all clients */ 301 301 device_for_each_child(ctrl->dev, NULL, slim_ctrl_remove_device); 302 - ida_simple_remove(&ctrl_ida, ctrl->id); 302 + ida_free(&ctrl_ida, ctrl->id); 303 303 304 304 return 0; 305 305 } ··· 323 323 sbdev->is_laddr_valid = false; 324 324 mutex_unlock(&ctrl->lock); 325 325 if (!ctrl->get_laddr) 326 - ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr); 326 + ida_free(&ctrl->laddr_ida, sbdev->laddr); 327 327 slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN); 328 328 } 329 329 EXPORT_SYMBOL_GPL(slim_report_absent);