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-2-brgl@bgdev.pl>
Date:   Thu, 19 Nov 2020 12:40:51 +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 01/59] rtc: da9055: 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-da9055.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/rtc/rtc-da9055.c b/drivers/rtc/rtc-da9055.c
index 844168fcae1e..1e76042c2ed7 100644
--- a/drivers/rtc/rtc-da9055.c
+++ b/drivers/rtc/rtc-da9055.c
@@ -279,23 +279,22 @@ static int da9055_rtc_probe(struct platform_device *pdev)
 
 	ret = da9055_rtc_device_init(rtc->da9055, pdata);
 	if (ret < 0)
-		goto err_rtc;
+		return ret;
 
 	ret = da9055_reg_read(rtc->da9055, DA9055_REG_ALARM_Y);
 	if (ret < 0)
-		goto err_rtc;
+		return ret;
 
 	if (ret & DA9055_RTC_ALM_EN)
 		rtc->alarm_enable = 1;
 
 	device_init_wakeup(&pdev->dev, 1);
 
-	rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
-					&da9055_rtc_ops, THIS_MODULE);
-	if (IS_ERR(rtc->rtc)) {
-		ret = PTR_ERR(rtc->rtc);
-		goto err_rtc;
-	}
+	rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+	if (IS_ERR(rtc->rtc))
+		return PTR_ERR(rtc->rtc);
+
+	rtc->rtc->ops = &da9055_rtc_ops;
 
 	alm_irq = platform_get_irq_byname(pdev, "ALM");
 	if (alm_irq < 0)
@@ -308,9 +307,7 @@ static int da9055_rtc_probe(struct platform_device *pdev)
 	if (ret != 0)
 		dev_err(rtc->da9055->dev, "irq registration failed: %d\n", ret);
 
-err_rtc:
-	return ret;
-
+	return devm_rtc_register_device(rtc->rtc);
 }
 
 #ifdef CONFIG_PM
-- 
2.29.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ