From: keliu <liuke94@huawei.com>
To: <morbidrsa@gmail.com>, <linux-kernel@vger.kernel.org>
Cc: keliu <liuke94@huawei.com>
Subject: [PATCH] drivers: mcb: Directly use ida_alloc()/free()
Date: Fri, 27 May 2022 07:11:56 +0000 [thread overview]
Message-ID: <20220527071156.2359578-1-liuke94@huawei.com> (raw)
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .
Signed-off-by: keliu <liuke94@huawei.com>
---
drivers/mcb/mcb-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
index cf128b3471d7..338fc889b357 100644
--- a/drivers/mcb/mcb-core.c
+++ b/drivers/mcb/mcb-core.c
@@ -254,7 +254,7 @@ static void mcb_free_bus(struct device *dev)
struct mcb_bus *bus = to_mcb_bus(dev);
put_device(bus->carrier);
- ida_simple_remove(&mcb_ida, bus->bus_nr);
+ ida_free(&mcb_ida, bus->bus_nr);
kfree(bus);
}
@@ -273,7 +273,7 @@ struct mcb_bus *mcb_alloc_bus(struct device *carrier)
if (!bus)
return ERR_PTR(-ENOMEM);
- bus_nr = ida_simple_get(&mcb_ida, 0, 0, GFP_KERNEL);
+ bus_nr = ida_alloc(&mcb_ida, GFP_KERNEL);
if (bus_nr < 0) {
kfree(bus);
return ERR_PTR(bus_nr);
--
2.25.1
next reply other threads:[~2022-05-27 6:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 7:11 keliu [this message]
2022-06-10 12:18 ` Johannes Thumshirn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220527071156.2359578-1-liuke94@huawei.com \
--to=liuke94@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=morbidrsa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®