[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220926012708.3265-1-liubo03@inspur.com>
Date: Sun, 25 Sep 2022 21:27:08 -0400
From: Bo Liu <liubo03@...pur.com>
To: <peda@...ntia.se>
CC: <linux-kernel@...r.kernel.org>, Bo Liu <liubo03@...pur.com>
Subject: [PATCH] mux: Remove usage of the deprecated ida_simple_xxx API
Use ida_alloc()/ida_free() instead of
ida_simple_get()/ida_simple_remove().
The latter is deprecated and more verbose.
Signed-off-by: Bo Liu <liubo03@...pur.com>
---
drivers/mux/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mux/core.c b/drivers/mux/core.c
index 49bedbe6316c..0f5c76109bb6 100644
--- a/drivers/mux/core.c
+++ b/drivers/mux/core.c
@@ -66,7 +66,7 @@ static void mux_chip_release(struct device *dev)
{
struct mux_chip *mux_chip = to_mux_chip(dev);
- ida_simple_remove(&mux_ida, mux_chip->id);
+ ida_free(&mux_ida, mux_chip->id);
kfree(mux_chip);
}
@@ -113,7 +113,7 @@ struct mux_chip *mux_chip_alloc(struct device *dev,
mux_chip->dev.of_node = dev->of_node;
dev_set_drvdata(&mux_chip->dev, mux_chip);
- mux_chip->id = ida_simple_get(&mux_ida, 0, 0, GFP_KERNEL);
+ mux_chip->id = ida_alloc(&mux_ida, GFP_KERNEL);
if (mux_chip->id < 0) {
int err = mux_chip->id;
--
2.27.0
Powered by blists - more mailing lists