linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: class: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-19  5:07 Christophe JAILLET
  2024-01-08  0:49 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-12-19  5:07 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-rtc

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Commit 592ff0c8d064 ("rtc: Directly use ida_alloc()/free()") missed this
call
---
 drivers/rtc/class.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index edfd942f8c54..921ee1827974 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -256,7 +256,7 @@ static int rtc_device_get_id(struct device *dev)
 		of_id = of_alias_get_id(dev->parent->of_node, "rtc");
 
 	if (of_id >= 0) {
-		id = ida_simple_get(&rtc_ida, of_id, of_id + 1, GFP_KERNEL);
+		id = ida_alloc_range(&rtc_ida, of_id, of_id, GFP_KERNEL);
 		if (id < 0)
 			dev_warn(dev, "/aliases ID %d not available\n", of_id);
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: class: Remove usage of the deprecated ida_simple_xx() API
  2023-12-19  5:07 [PATCH] rtc: class: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2024-01-08  0:49 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2024-01-08  0:49 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: linux-kernel, kernel-janitors, linux-rtc


On Tue, 19 Dec 2023 06:07:12 +0100, Christophe JAILLET wrote:
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
> 
> This is less verbose.
> 
> 

Applied, thanks!

[1/1] rtc: class: Remove usage of the deprecated ida_simple_xx() API
      commit: e3d3fe7e7bf08820a83c9d9a4c38c7b29a2927f1

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-08  0:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19  5:07 [PATCH] rtc: class: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2024-01-08  0:49 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).