mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Platschek <andreas.platschek@opentech.at>
To: linux-kernel@vger.kernel.org
Cc: a.zummo@towertech.it, alexandre.belloni@free-electrons.com,
	linux-rtc@vger.kernel.org,
	Andreas Platschek <andreas.platschek@opentech.at>
Subject: [PATCH 1/2] rtc: omap: check for clk_prepare_enable() error
Date: Wed,  6 Dec 2017 20:42:37 +0100	[thread overview]
Message-ID: <20171206194238.12824-2-andreas.platschek@opentech.at> (raw)
In-Reply-To: <20171206194238.12824-1-andreas.platschek@opentech.at>

clk_prepare_enable() returns an error -> check it.

Signed-off-by: Andreas Platschek <andreas.platschek@opentech.at>
---
 drivers/rtc/rtc-omap.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 1d666ac9ef70..ad309feb7d11 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -748,8 +748,15 @@ static int omap_rtc_probe(struct platform_device *pdev)
 	else
 		rtc->clk = devm_clk_get(&pdev->dev, "int-clk");
 
-	if (!IS_ERR(rtc->clk))
-		clk_prepare_enable(rtc->clk);
+	if (!IS_ERR(rtc->clk)) {
+		ret = clk_prepare_enable(rtc->clk);
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Failed to enable rtc clk (%u)\n", ret);
+			return ret;
+		}
+	}
+
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	rtc->base = devm_ioremap_resource(&pdev->dev, res);
-- 
2.11.0

  reply	other threads:[~2017-12-06 19:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 19:42 [PATCH 0/2] rtc: omap: clk_prepare_enable error handling Andreas Platschek
2017-12-06 19:42 ` Andreas Platschek [this message]
2017-12-18 21:42   ` [PATCH 1/2] rtc: omap: check for clk_prepare_enable() error Alexandre Belloni
2017-12-06 19:42 ` [PATCH 2/2] rtc: omap: fix unbalanced clk_prepare_enable/clk_disable_unprepare Andreas Platschek
2017-12-18 21:49   ` 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=20171206194238.12824-2-andreas.platschek@opentech.at \
    --to=andreas.platschek@opentech.at \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.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

all inboxes | Powered by JetHome®