From: Dario Binacchi <dariobin@libero.it>
To: u-boot@lists.denx.de
Subject: [PATCH v3 11/27] ti: am33xx: fix do_enable_clocks() to accept NULL parameters
Date: Sun, 11 Oct 2020 14:13:24 +0200 [thread overview]
Message-ID: <20201011121340.21660-12-dariobin@libero.it> (raw)
In-Reply-To: <20201011121340.21660-1-dariobin@libero.it>
Up till this commit passing NULL as input parameter was allowed, but not
handled properly. When a NULL parameter was passed to the function a data
abort was raised.
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
---
(no changes since v1)
arch/arm/mach-omap2/am33xx/clock.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/am33xx/clock.c b/arch/arm/mach-omap2/am33xx/clock.c
index 8819062aaa..130ee6c6e3 100644
--- a/arch/arm/mach-omap2/am33xx/clock.c
+++ b/arch/arm/mach-omap2/am33xx/clock.c
@@ -194,13 +194,14 @@ void do_enable_clocks(u32 *const *clk_domains,
u32 i, max = 100;
/* Put the clock domains in SW_WKUP mode */
- for (i = 0; (i < max) && clk_domains[i]; i++) {
+ for (i = 0; (i < max) && clk_domains && clk_domains[i]; i++) {
enable_clock_domain(clk_domains[i],
CD_CLKCTRL_CLKTRCTRL_SW_WKUP);
}
/* Clock modules that need to be put in SW_EXPLICIT_EN mode */
- for (i = 0; (i < max) && clk_modules_explicit_en[i]; i++) {
+ for (i = 0; (i < max) && clk_modules_explicit_en &&
+ clk_modules_explicit_en[i]; i++) {
enable_clock_module(clk_modules_explicit_en[i],
MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN,
wait_for_enable);
@@ -215,12 +216,13 @@ void do_disable_clocks(u32 *const *clk_domains,
/* Clock modules that need to be put in SW_DISABLE */
- for (i = 0; (i < max) && clk_modules_disable[i]; i++)
+ for (i = 0; (i < max) && clk_modules_disable && clk_modules_disable[i];
+ i++)
disable_clock_module(clk_modules_disable[i],
wait_for_disable);
/* Put the clock domains in SW_SLEEP mode */
- for (i = 0; (i < max) && clk_domains[i]; i++)
+ for (i = 0; (i < max) && clk_domains && clk_domains[i]; i++)
disable_clock_domain(clk_domains[i]);
}
--
2.17.1
next prev parent reply other threads:[~2020-10-11 12:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-11 12:13 [PATCH v3 00/27] Add DM support for omap PWM backlight Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 01/27] clk: export generic routines Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 02/27] dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7 Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 03/27] bus: ti: add minimal sysc interconnect target driver Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 04/27] arm: dts: sync am33xx with Linux 5.9-rc7 Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 05/27] clk: add clk_round_rate() Dario Binacchi
2020-10-11 12:26 ` Sean Anderson
2020-10-11 12:13 ` [PATCH v3 06/27] clk: ti: add mux clock driver Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 07/27] arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 08/27] clk: ti: am33xx: add DPLL clock drivers Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 09/27] clk: ti: add divider clock driver Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 10/27] clk: ti: add gate " Dario Binacchi
2020-10-11 12:13 ` Dario Binacchi [this message]
2020-10-11 12:13 ` [PATCH v3 12/27] clk: ti: add support for clkctrl clocks Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 13/27] clk: ti: move drivers to 'ti' directory Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 14/27] clk: ti: omap4: add clock manager driver Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 15/27] clk: ti: am335x: " Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 16/27] fdt: translate address if #size-cells = <0> Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 17/27] omap: timer: fix the rate setting Dario Binacchi
2020-10-11 12:13 ` [PATCH v3 18/27] misc: am33xx: add control module driver Dario Binacchi
2020-10-14 8:22 ` [PATCH v3 00/27] Add DM support for omap PWM backlight Felix Brack
2020-10-14 21:22 ` Dario Binacchi
2020-10-15 8:53 ` Felix Brack
2020-10-15 18:56 ` Dario Binacchi
2020-10-16 8:41 ` Felix Brack
2020-10-16 20:31 ` Dario Binacchi
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=20201011121340.21660-12-dariobin@libero.it \
--to=dariobin@libero.it \
--cc=u-boot@lists.denx.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