]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (ibmaem) Directly use ida_alloc()/free()
authorkeliu <liuke94@huawei.com>
Tue, 17 May 2022 06:31:26 +0000 (06:31 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 22 May 2022 18:32:32 +0000 (11:32 -0700)
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>
drivers/hwmon/ibmaem.c

index de6baf6ca3d1e007debad7768cc1df82885b5f45..5c4cf742f5ae7bf6c190b279d31f2001a91cb5d6 100644 (file)
@@ -482,7 +482,7 @@ static void aem_delete(struct aem_data *data)
        ipmi_destroy_user(data->ipmi.user);
        platform_set_drvdata(data->pdev, NULL);
        platform_device_unregister(data->pdev);
-       ida_simple_remove(&aem_ida, data->id);
+       ida_free(&aem_ida, data->id);
        kfree(data);
 }
 
@@ -539,7 +539,7 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
                data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
 
        /* Create sub-device for this fw instance */
-       data->id = ida_simple_get(&aem_ida, 0, 0, GFP_KERNEL);
+       data->id = ida_alloc(&aem_ida, GFP_KERNEL);
        if (data->id < 0)
                goto id_err;
 
@@ -600,7 +600,7 @@ ipmi_err:
        platform_set_drvdata(data->pdev, NULL);
        platform_device_unregister(data->pdev);
 dev_err:
-       ida_simple_remove(&aem_ida, data->id);
+       ida_free(&aem_ida, data->id);
 id_err:
        kfree(data);
 
@@ -679,7 +679,7 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
                data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
 
        /* Create sub-device for this fw instance */
-       data->id = ida_simple_get(&aem_ida, 0, 0, GFP_KERNEL);
+       data->id = ida_alloc(&aem_ida, GFP_KERNEL);
        if (data->id < 0)
                goto id_err;
 
@@ -740,7 +740,7 @@ ipmi_err:
        platform_set_drvdata(data->pdev, NULL);
        platform_device_unregister(data->pdev);
 dev_err:
-       ida_simple_remove(&aem_ida, data->id);
+       ida_free(&aem_ida, data->id);
 id_err:
        kfree(data);