Skip to content

Commit be1ca36

Browse files
keliugroeck
authored andcommitted
hwmon: (ibmaem) 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> Link: https://lore.kernel.org/r/20220517063126.2142637-2-liuke94@huawei.com [groeck: Updated subject to include driver name] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 718fbfa commit be1ca36

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/hwmon/ibmaem.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ static void aem_delete(struct aem_data *data)
482482
ipmi_destroy_user(data->ipmi.user);
483483
platform_set_drvdata(data->pdev, NULL);
484484
platform_device_unregister(data->pdev);
485-
ida_simple_remove(&aem_ida, data->id);
485+
ida_free(&aem_ida, data->id);
486486
kfree(data);
487487
}
488488

@@ -539,7 +539,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
539539
data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
540540

541541
/* Create sub-device for this fw instance */
542-
data->id = ida_simple_get(&aem_ida, 0, 0, GFP_KERNEL);
542+
data->id = ida_alloc(&aem_ida, GFP_KERNEL);
543543
if (data->id < 0)
544544
goto id_err;
545545

@@ -600,7 +600,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
600600
platform_set_drvdata(data->pdev, NULL);
601601
platform_device_unregister(data->pdev);
602602
dev_err:
603-
ida_simple_remove(&aem_ida, data->id);
603+
ida_free(&aem_ida, data->id);
604604
id_err:
605605
kfree(data);
606606

@@ -679,7 +679,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
679679
data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
680680

681681
/* Create sub-device for this fw instance */
682-
data->id = ida_simple_get(&aem_ida, 0, 0, GFP_KERNEL);
682+
data->id = ida_alloc(&aem_ida, GFP_KERNEL);
683683
if (data->id < 0)
684684
goto id_err;
685685

@@ -740,7 +740,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
740740
platform_set_drvdata(data->pdev, NULL);
741741
platform_device_unregister(data->pdev);
742742
dev_err:
743-
ida_simple_remove(&aem_ida, data->id);
743+
ida_free(&aem_ida, data->id);
744744
id_err:
745745
kfree(data);
746746

0 commit comments

Comments
 (0)