From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: pdeschrijver@nvidia.com, pgaikwad@nvidia.com,
jonathanh@nvidia.co, thierry.reding@gmail.com,
linux-kernel@lists.codethink.co.uk,
Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [PATCH 7/8] clk: tegra: replace warn on with single line
Date: Fri, 20 Jul 2018 14:45:31 +0100 [thread overview]
Message-ID: <20180720134532.13148-8-ben.dooks@codethink.co.uk> (raw)
In-Reply-To: <20180720134532.13148-1-ben.dooks@codethink.co.uk>
The use of WARN_ON(1) is a bit extreme for something that is called from
very few places. Add a function to print the ID (and maybe more info if
people really want it).
This was done as during the development of the tegra-automotive branches
we got swamped with clock errors of not very useful data.
Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
drivers/clk/tegra/clk.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/tegra/clk.c b/drivers/clk/tegra/clk.c
index a2cb3d0d38bf..3bba3509ca1f 100644
--- a/drivers/clk/tegra/clk.c
+++ b/drivers/clk/tegra/clk.c
@@ -258,6 +258,11 @@ void __init tegra_init_dup_clks(struct tegra_clk_duplicate *dup_list,
}
}
+static void tegra_clk_init_error(struct tegra_clk_init_table *tbl)
+{
+ pr_err("ERROR: Failed to initialise clock id %d\n", tbl->clk_id);
+}
+
void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
struct clk *clks[], int clk_max)
{
@@ -268,8 +273,7 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
if (IS_ERR_OR_NULL(clk)) {
pr_err("%s: invalid entry %ld in clks array for id %d\n",
__func__, PTR_ERR(clk), tbl->clk_id);
- WARN_ON(1);
-
+ tegra_clk_init_error(tbl);
continue;
}
@@ -279,7 +283,7 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
pr_err("%s: Failed to set parent %s of %s\n",
__func__, __clk_get_name(parent),
__clk_get_name(clk));
- WARN_ON(1);
+ tegra_clk_init_error(tbl);
}
}
@@ -288,14 +292,14 @@ void __init tegra_init_from_table(struct tegra_clk_init_table *tbl,
pr_err("%s: Failed to set rate %lu of %s\n",
__func__, tbl->rate,
__clk_get_name(clk));
- WARN_ON(1);
+ tegra_clk_init_error(tbl);
}
if (tbl->state)
if (clk_prepare_enable(clk)) {
pr_err("%s: Failed to enable %s\n", __func__,
__clk_get_name(clk));
- WARN_ON(1);
+ tegra_clk_init_error(tbl);
}
}
}
--
2.18.0
next prev parent reply other threads:[~2018-07-20 13:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 13:45 tegra clock updates and fixes Ben Dooks
2018-07-20 13:45 ` [PATCH 1/8] clk: tegra: implement reset status callback Ben Dooks
2018-07-20 13:45 ` [PATCH 2/8] clk: tegra: host1x has fractional divider Ben Dooks
2018-07-23 8:50 ` Peter De Schrijver
2018-07-23 9:32 ` Ben Dooks
2018-07-23 11:12 ` Peter De Schrijver
2018-07-23 11:32 ` Ben Dooks
2018-07-20 13:45 ` [PATCH 3/8] clk: tegra: fix fractional clocks for VDI, VI, EPP, MPE, 2D and 3D Ben Dooks
2018-07-23 8:50 ` Peter De Schrijver
2018-07-20 13:45 ` [PATCH 4/8] clk: tegra: fix MUX_I2S_SPDIF macro Ben Dooks
2018-07-20 13:45 ` [PATCH 5/8] clk: tegra: add mux-only clock option Ben Dooks
2018-07-20 13:45 ` [PATCH 6/8] clk: tegra30: add 2d and 3d idle clocks Ben Dooks
2018-07-22 11:55 ` Dmitry Osipenko
2018-07-23 8:28 ` Ben Dooks
2018-07-23 11:33 ` Dmitry Osipenko
2018-07-23 11:37 ` Ben Dooks
2018-07-23 13:05 ` Dmitry Osipenko
2018-07-24 11:31 ` Dmitry Osipenko
2018-07-24 12:32 ` Ben Dooks
2018-07-20 13:45 ` Ben Dooks [this message]
2018-07-20 13:45 ` [PATCH 8/8] clk: tegra: show clock name in error from _calc_rate Ben Dooks
2018-07-26 13:32 ` tegra clock updates and fixes Ben Dooks
2018-07-26 15:22 ` Stephen Boyd
2018-07-27 8:22 ` Ben Dooks
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=20180720134532.13148-8-ben.dooks@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=jonathanh@nvidia.co \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@lists.codethink.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=pdeschrijver@nvidia.com \
--cc=pgaikwad@nvidia.com \
--cc=thierry.reding@gmail.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;
as well as URLs for NNTP newsgroup(s).