From: Sam Ravnborg <sam@ravnborg.org>
To: barebox@lists.infradead.org, "Alexander Kurz" <akurz@blala.de>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: [PATCH 1/3] clk: fix clk_get error handling
Date: Wed, 5 Jul 2017 20:32:35 +0200 [thread overview]
Message-ID: <20170705183235.GA17038@ravnborg.org> (raw)
In-Reply-To: <20170705182747.GB13920@ravnborg.org>
From 20397009e13e6111c8b17e5cbaf0addf3aaf593a Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <srn@skov.dk>
Date: Mon, 3 Jul 2017 21:21:02 +0200
Subject: [PATCH 1/3] clk: fix clk_get error handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If there is no OFTREE support of_clk_get_by_name failed with
-ENOENT, which caused clk_get to bail out.
This had the effect that nothing was printed on the serial console
with at91sam9263-ek.
There are no error paths that will return -ENODEV as we test for today,
so change this to -ENOENT which is in use.
This allows us to contine with clk_get_sys() in case of other
errors as was the intention of the original fix.
Fixes: 90f7eacb ("clk: let clk_get return errors from of_clk_get_by_name")
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
drivers/clk/clkdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index 6b1666355..abdc41527 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -181,7 +181,7 @@ struct clk *clk_get(struct device_d *dev, const char *con_id)
if (dev) {
clk = of_clk_get_by_name(dev->device_node, con_id);
- if (!IS_ERR(clk) || PTR_ERR(clk) != -ENODEV)
+ if (!IS_ERR(clk) || PTR_ERR(clk) != -ENOENT)
return clk;
}
--
2.12.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-07-05 18:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-05 18:27 [PATCH v2 0/3] diverse at91 related fixes Sam Ravnborg
2017-07-05 18:32 ` Sam Ravnborg [this message]
2017-07-05 18:33 ` [PATCH 2/3] gpio: fix null pointer exception when there is no oftree Sam Ravnborg
2017-07-06 12:46 ` Lucas Stach
2017-07-06 20:53 ` Alexander Kurz
2017-07-07 12:42 ` Lucas Stach
2017-07-05 18:34 ` [PATCH 3/3] arm: at91 bootstrap: declare local function static Sam Ravnborg
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=20170705183235.GA17038@ravnborg.org \
--to=sam@ravnborg.org \
--cc=akurz@blala.de \
--cc=barebox@lists.infradead.org \
--cc=u.kleine-koenig@pengutronix.de \
/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