[PATCH] checkpatch: mark 'devm_rtc_device_register' deprecated

From: Ciprian Costea
Date: Tue Oct 15 2024 - 07:00:47 EST


From: Ciprian Marian Costea <ciprianmarian.costea@xxxxxxxxxxx>

devm_rtc_device_register() is marked as deprecated in its
declaration comment [1].

Furthermore, comments [2] and [3] emphasize that devm_rtc_device_register()
is deprecated and that devm_rtc_allocate_device()
and [devm_]rtc_register_device should be used instead.

Add devm_rtc_device_register() to the list of deprecated apis.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/rtc/class.c#n455
[2] https://lore.kernel.org/lkml/20220921114624.3250848-2-linux@xxxxxxxxxxxxxxxxxx/
[3] https://lore.kernel.org/lkml/6659aa90-53c5-4a91-a9f9-01120c88f107@xxxxxxxxxxx/

Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@xxxxxxxxxxx>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4427572b2477..daa1fd2d4a5b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -848,6 +848,7 @@ our %deprecated_apis = (
"kunmap" => "kunmap_local",
"kmap_atomic" => "kmap_local_page",
"kunmap_atomic" => "kunmap_local",
+ "devm_rtc_device_register" => "devm_rtc_allocate_device' and 'devm_rtc_register_device",
);

#Create a search pattern for all these strings to speed up a loop below
--
2.45.2