[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220517125049.GA3500570@roeck-us.net>
Date: Tue, 17 May 2022 05:50:49 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: keliu <liuke94@...wei.com>
Cc: jdelvare@...e.com, linux-hwmon@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] hwmon: Directly use ida_alloc()/free()
On Tue, May 17, 2022 at 06:31:26AM +0000, keliu wrote:
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
>
> Signed-off-by: keliu <liuke94@...wei.com>
Applied, after updating subject to include the driver name.
Guenter
> ---
> drivers/hwmon/ibmaem.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c
> index de6baf6ca3d1..5c4cf742f5ae 100644
> --- a/drivers/hwmon/ibmaem.c
> +++ b/drivers/hwmon/ibmaem.c
> @@ -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 @@ static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
> 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 @@ static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
> 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);
>
Powered by blists - more mailing lists