From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
Date: Tue, 13 Jan 2015 19:21:48 -0600 [thread overview]
Message-ID: <20150114012148.GE18523@saruman> (raw)
In-Reply-To: <1421190837-4692-3-git-send-email-tony@atomide.com>
On Tue, Jan 13, 2015 at 03:13:52PM -0800, Tony Lindgren wrote:
> We need to check if we got the clock before trying to do anything
> with it. Otherwise we will get something like this:
>
> Unable to handle kernel paging request at virtual address fffffffe
> ...
> [<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8)
> [<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0)
> ...
>
> Let's add check for the clock and WARN if the init clock was not
> found.
>
> Cc: Brian Hutchinson <b.hutchman@gmail.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
Just one minor nit below, other than that:
Reviewed-by: Felipe Balbi <balbi@ti.com>
> ---
> arch/arm/mach-omap2/clock.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
> index 6ad5b4d..89a0732 100644
> --- a/arch/arm/mach-omap2/clock.c
> +++ b/arch/arm/mach-omap2/clock.c
> @@ -620,6 +620,11 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
>
> for (i = 0; i < num_clocks; i++) {
> init_clk = clk_get(NULL, clk_names[i]);
> + if (IS_ERR(init_clk)) {
> + WARN(1, "omap clock: could not find init clock %s\n",
> + clk_names[i]);
you can combine the if with the WARN():
if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
clk_names[i]))
not that I also removed that "omap clock" prefix because WARN() will
print the file name anyway.
> + continue;
> + }
> clk_prepare_enable(init_clk);
> }
> }
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150113/f31d214b/attachment.sig>
next prev parent reply other threads:[~2015-01-14 1:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-13 23:13 [PATCH 0/7] Fixes and clean-up in preparation for booting ti81xx Tony Lindgren
2015-01-13 23:13 ` [PATCH 1/7] ARM: OMAP2+: Remove unused ti81xx platform init code Tony Lindgren
2015-01-14 1:19 ` Felipe Balbi
2015-01-14 17:19 ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 2/7] ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks Tony Lindgren
2015-01-14 1:21 ` Felipe Balbi [this message]
2015-01-14 17:27 ` Tony Lindgren
2015-01-13 23:13 ` [PATCH 3/7] ARM: OMAP2+: Fix ti81xx devtype Tony Lindgren
2015-01-13 23:13 ` [PATCH 4/7] ARM: OMAP2+: Fix ti81xx class type Tony Lindgren
2015-01-13 23:13 ` [PATCH 5/7] ARM: OMAP2+: Fix dm814 and dm816 for clocks and timer init Tony Lindgren
2015-01-13 23:13 ` [PATCH 6/7] ARM: OMAP2+: Fix reboot for 81xx Tony Lindgren
2015-01-14 1:24 ` Felipe Balbi
2015-01-14 19:04 ` Tony Lindgren
2015-01-14 19:30 ` Felipe Balbi
2015-01-13 23:13 ` [PATCH 7/7] ARM: OMAP2+: Disable omap3 PM init for ti81xx Tony Lindgren
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=20150114012148.GE18523@saruman \
--to=balbi@ti.com \
--cc=linux-arm-kernel@lists.infradead.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).