[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240902122435.2716681-1-lihongbo22@huawei.com>
Date: Mon, 2 Sep 2024 20:24:35 +0800
From: Hongbo Li <lihongbo22@...wei.com>
To: <jens.wiklander@...aro.org>, <arnd@...db.de>, <gregkh@...uxfoundation.org>
CC: <linux-kernel@...r.kernel.org>, <lihongbo22@...wei.com>
Subject: [PATCH -next] rpmb: Remove usage of the deprecated ida_simple_xx() API
The ida_alloc() and ida_free() should be preferred to the
deprecated ida_simple_get() and ida_simple_remove().
Signed-off-by: Hongbo Li <lihongbo22@...wei.com>
---
drivers/misc/rpmb-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/rpmb-core.c b/drivers/misc/rpmb-core.c
index c8888267c222..ce45ec968de1 100644
--- a/drivers/misc/rpmb-core.c
+++ b/drivers/misc/rpmb-core.c
@@ -64,7 +64,7 @@ static void rpmb_dev_release(struct device *dev)
struct rpmb_dev *rdev = to_rpmb_dev(dev);
mutex_lock(&rpmb_mutex);
- ida_simple_remove(&rpmb_ida, rdev->id);
+ ida_free(&rpmb_ida, rdev->id);
mutex_unlock(&rpmb_mutex);
kfree(rdev->descr.dev_id);
kfree(rdev);
@@ -176,7 +176,7 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev,
}
mutex_lock(&rpmb_mutex);
- ret = ida_simple_get(&rpmb_ida, 0, 0, GFP_KERNEL);
+ ret = ida_alloc(&rpmb_ida, GFP_KERNEL);
mutex_unlock(&rpmb_mutex);
if (ret < 0)
goto err_free_dev_id;
@@ -196,7 +196,7 @@ struct rpmb_dev *rpmb_dev_register(struct device *dev,
err_id_remove:
mutex_lock(&rpmb_mutex);
- ida_simple_remove(&rpmb_ida, rdev->id);
+ ida_free(&rpmb_ida, rdev->id);
mutex_unlock(&rpmb_mutex);
err_free_dev_id:
kfree(rdev->descr.dev_id);
--
2.34.1
Powered by blists - more mailing lists