lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-58-brgl@bgdev.pl>
Date:   Thu, 19 Nov 2020 12:41:47 +0100
From:   Bartosz Golaszewski <brgl@...ev.pl>
To:     Alessandro Zummo <a.zummo@...ertech.it>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc:     linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH 57/59] rtc: as3722: stop using deprecated RTC API

From: Bartosz Golaszewski <bgolaszewski@...libre.com>

devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
 drivers/rtc/rtc-as3722.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-as3722.c b/drivers/rtc/rtc-as3722.c
index 0f21af27f4cf..90e70279a5d4 100644
--- a/drivers/rtc/rtc-as3722.c
+++ b/drivers/rtc/rtc-as3722.c
@@ -189,14 +189,11 @@ static int as3722_rtc_probe(struct platform_device *pdev)
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	as3722_rtc->rtc = devm_rtc_device_register(&pdev->dev, "as3722-rtc",
-				&as3722_rtc_ops, THIS_MODULE);
-	if (IS_ERR(as3722_rtc->rtc)) {
-		ret = PTR_ERR(as3722_rtc->rtc);
-		dev_err(&pdev->dev, "RTC register failed: %d\n", ret);
-		return ret;
-	}
+	as3722_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(as3722_rtc->rtc))
+		return PTR_ERR(as3722_rtc->rtc);
 
+	as3722_rtc->rtc->ops = &as3722_rtc_ops;
 	as3722_rtc->alarm_irq = platform_get_irq(pdev, 0);
 	dev_info(&pdev->dev, "RTC interrupt %d\n", as3722_rtc->alarm_irq);
 
@@ -209,7 +206,8 @@ static int as3722_rtc_probe(struct platform_device *pdev)
 		return ret;
 	}
 	disable_irq(as3722_rtc->alarm_irq);
-	return 0;
+
+	return devm_rtc_register_device(as3722_rtc->rtc);
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.29.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ