linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org
Subject: [PATCH 3/4] rtc: s5m: enable wakeup only when available
Date: Wed,  4 Aug 2021 12:41:31 +0200	[thread overview]
Message-ID: <20210804104133.5158-3-alexandre.belloni@bootlin.com> (raw)
In-Reply-To: <20210804104133.5158-1-alexandre.belloni@bootlin.com>

Call device_init_wakeup() only when alarms are available and the RTC is
actually able to wake up the system.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-s5m.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index ee195697e6c6..87df797758fc 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -786,8 +786,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	device_init_wakeup(&pdev->dev, 1);
-
 	info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
 	if (IS_ERR(info->rtc_dev))
 		return PTR_ERR(info->rtc_dev);
@@ -805,6 +803,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
 				info->irq, ret);
 			return ret;
 		}
+		device_init_wakeup(&pdev->dev, 1);
 	}
 
 	return devm_rtc_register_device(info->rtc_dev);
-- 
2.31.1


  parent reply	other threads:[~2021-08-04 10:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 10:41 [PATCH 1/4] rtc: s5m: switch to devm_rtc_allocate_device Alexandre Belloni
2021-08-04 10:41 ` [PATCH 2/4] rtc: s5m: signal the core when alarm are not available Alexandre Belloni
2021-08-04 11:48   ` Krzysztof Kozlowski
2021-08-04 10:41 ` Alexandre Belloni [this message]
2021-08-04 11:48   ` [PATCH 3/4] rtc: s5m: enable wakeup only when available Krzysztof Kozlowski
2021-08-04 10:41 ` [PATCH 4/4] rtc: s5m: set range Alexandre Belloni
2021-08-04 12:01   ` Krzysztof Kozlowski
2021-08-04 11:43 ` [PATCH 1/4] rtc: s5m: switch to devm_rtc_allocate_device Krzysztof Kozlowski

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=20210804104133.5158-3-alexandre.belloni@bootlin.com \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=b.zolnierkie@samsung.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-samsung-soc@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).