linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: [PATCH 1/8] rtc: omap: use devm_pinctrl_register()
Date: Mon,  9 Nov 2020 17:34:02 +0100	[thread overview]
Message-ID: <20201109163409.24301-2-brgl@bgdev.pl> (raw)
In-Reply-To: <20201109163409.24301-1-brgl@bgdev.pl>

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Use a managed variant of pinctrl_register(). This way we can shorten
the remove() callback as well as drop a goto label from probe().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/rtc/rtc-omap.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index c20fc7937dfa..606fa80ad6e0 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -879,7 +879,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
 	/* Support ext_wakeup pinconf */
 	rtc_pinctrl_desc.name = dev_name(&pdev->dev);
 
-	rtc->pctldev = pinctrl_register(&rtc_pinctrl_desc, &pdev->dev, rtc);
+	rtc->pctldev = devm_pinctrl_register(&pdev->dev, &rtc_pinctrl_desc, rtc);
 	if (IS_ERR(rtc->pctldev)) {
 		dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
 		ret = PTR_ERR(rtc->pctldev);
@@ -888,7 +888,7 @@ static int omap_rtc_probe(struct platform_device *pdev)
 
 	ret = rtc_register_device(rtc->rtc);
 	if (ret)
-		goto err_deregister_pinctrl;
+		goto err;
 
 	rtc_nvmem_register(rtc->rtc, &omap_rtc_nvmem_config);
 
@@ -901,8 +901,6 @@ static int omap_rtc_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_deregister_pinctrl:
-	pinctrl_unregister(rtc->pctldev);
 err:
 	clk_disable_unprepare(rtc->clk);
 	device_init_wakeup(&pdev->dev, false);
@@ -945,9 +943,6 @@ static int omap_rtc_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
-	/* Remove ext_wakeup pinconf */
-	pinctrl_unregister(rtc->pctldev);
-
 	return 0;
 }
 
-- 
2.29.1


  reply	other threads:[~2020-11-09 16:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 16:34 [PATCH 0/8] rtc: rework resource management Bartosz Golaszewski
2020-11-09 16:34 ` Bartosz Golaszewski [this message]
2020-11-09 16:34 ` [PATCH 2/8] Revert "rtc: sc27xx: Always read normal alarm when registering RTC device" Bartosz Golaszewski
2020-11-17 21:23   ` Alexandre Belloni
2020-11-09 16:34 ` [PATCH 3/8] Documentation: list RTC devres helpers in devres.rst Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 4/8] rtc: nvmem: remove nvram ABI Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 5/8] rtc: add devm_ prefix to rtc_nvmem_register() Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 6/8] rtc: nvmem: emit an error message when nvmem registration fails Bartosz Golaszewski
2020-11-09 16:34 ` [PATCH 7/8] rtc: rework rtc_register_device() resource management Bartosz Golaszewski
2020-11-17 21:35   ` Alexandre Belloni
2020-11-18  8:13     ` Bartosz Golaszewski
     [not found]   ` <CAF2Aj3inp8=dn9xuc8f3uJbL+m5LH7W3BDoOeZyiiOupmbfgOw@mail.gmail.com>
2020-11-27  9:23     ` Bartosz Golaszewski
2020-11-27 13:22       ` Lee Jones
2020-11-09 16:34 ` [PATCH 8/8] rtc: shrink devm_rtc_allocate_device() Bartosz Golaszewski
2020-11-17 22:57 ` [PATCH 0/8] rtc: rework resource management Alexandre Belloni

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=20201109163409.24301-2-brgl@bgdev.pl \
    --to=brgl@bgdev.pl \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).