Linux RTC
 help / color / mirror / Atom feed
From: Dhruva Gole <d-gole@ti.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Vibhore Vardhan <vibhore@ti.com>, Dhruva Gole <d-gole@ti.com>,
	<linux-rtc@vger.kernel.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	<linux-kernel@vger.kernel.org>, Nishanth Menon <nm@ti.com>
Subject: [PATCH] rtc: k3: handle errors while enabling wake irq
Date: Thu, 23 Mar 2023 13:49:42 +0530	[thread overview]
Message-ID: <20230323081942.951542-1-d-gole@ti.com> (raw)

Due to the potential failure of enable_irq_wake(), it would be better to
check it and return error if it fails.

Fixes: b09d633575e5 ("rtc: Introduce ti-k3-rtc")
Cc: Nishanth Menon <nm@ti.com>
Signed-off-by: Dhruva Gole <d-gole@ti.com>
---
 drivers/rtc/rtc-ti-k3.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-ti-k3.c b/drivers/rtc/rtc-ti-k3.c
index ba23163cc042..ef9d7e1cf92e 100644
--- a/drivers/rtc/rtc-ti-k3.c
+++ b/drivers/rtc/rtc-ti-k3.c
@@ -630,9 +630,18 @@ MODULE_DEVICE_TABLE(of, ti_k3_rtc_of_match_table);
 static int __maybe_unused ti_k3_rtc_suspend(struct device *dev)
 {
 	struct ti_k3_rtc *priv = dev_get_drvdata(dev);
+	int error;
 
 	if (device_may_wakeup(dev))
-		enable_irq_wake(priv->irq);
+		error = enable_irq_wake(priv->irq);
+
+	if (error) {
+		dev_err(dev,
+			"failed to enable irq wake on IRQ %d: %d\n",
+			priv->irq, error);
+		return error;
+	}
+
 	return 0;
 }
 
-- 
2.25.1


             reply	other threads:[~2023-03-23  8:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  8:19 Dhruva Gole [this message]
2023-03-23  8:34 ` [PATCH] rtc: k3: handle errors while enabling wake irq 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=20230323081942.951542-1-d-gole@ti.com \
    --to=d-gole@ti.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=vibhore@ti.com \
    /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