From: rnayak@ti.com (Rajendra Nayak)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/7] omap: clock: Check for enable/disable ops support
Date: Thu, 10 Feb 2011 14:46:34 +0530 [thread overview]
Message-ID: <1297329400-5936-2-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1297329400-5936-1-git-send-email-rnayak@ti.com>
Check if enable/disable operations are supported for a given
clock node before attempting to call them.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/clock.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 2a2f152..e0f017d 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -261,7 +261,8 @@ void omap2_clk_disable(struct clk *clk)
pr_debug("clock: %s: disabling in hardware\n", clk->name);
- clk->ops->disable(clk);
+ if (clk->ops && clk->ops->disable)
+ clk->ops->disable(clk);
if (clk->clkdm)
omap2_clkdm_clk_disable(clk->clkdm, clk);
@@ -312,10 +313,13 @@ int omap2_clk_enable(struct clk *clk)
}
}
- ret = clk->ops->enable(clk);
- if (ret) {
- WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret);
- goto oce_err3;
+ if (clk->ops && clk->ops->enable) {
+ ret = clk->ops->enable(clk);
+ if (ret) {
+ WARN(1, "clock: %s: could not enable: %d\n",
+ clk->name, ret);
+ goto oce_err3;
+ }
}
return 0;
--
1.7.0.4
next prev parent reply other threads:[~2011-02-10 9:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-10 9:16 [PATCH v2 0/7] clock/dpll autoidle support Rajendra Nayak
2011-02-10 9:16 ` Rajendra Nayak [this message]
2011-02-10 9:16 ` [PATCH v2 2/7] omap3: dpll: Populate clkops for dpll1_ck Rajendra Nayak
2011-02-10 9:16 ` [PATCH v2 3/7] omap: clock: Add allow_idle/deny_idle support in clkops Rajendra Nayak
2011-02-10 9:16 ` [PATCH v2 4/7] omap: dpll: Add allow_idle/deny_idle support for all DPLL's Rajendra Nayak
2011-02-10 9:16 ` [PATCH v2 5/7] omap: dpll: Enable all OMAP3/4 dpll autoidle late at boot Rajendra Nayak
2011-02-10 9:16 ` [PATCH v2 6/7] omap4: dpll: Add dpll api to control GATE_CTRL Rajendra Nayak
2011-02-10 9:16 ` [PATCH v2 7/7] omap4: dpll: Enable auto gate control for all MX postdividers Rajendra Nayak
2011-02-13 1:10 ` Paul Walmsley
2011-02-14 12:34 ` Rajendra Nayak
2011-02-13 1:08 ` [PATCH v2 6/7] omap4: dpll: Add dpll api to control GATE_CTRL Paul Walmsley
2011-02-13 0:42 ` [PATCH v2 5/7] omap: dpll: Enable all OMAP3/4 dpll autoidle late at boot Paul Walmsley
2011-02-14 12:32 ` Rajendra Nayak
2011-02-14 16:52 ` Paul Walmsley
2011-02-16 22:37 ` Paul Walmsley
2011-02-13 0:28 ` [PATCH v2 4/7] omap: dpll: Add allow_idle/deny_idle support for all DPLL's Paul Walmsley
2011-02-14 12:29 ` Rajendra Nayak
2011-02-14 16:51 ` Paul Walmsley
2011-02-13 0:04 ` [PATCH v2 3/7] omap: clock: Add allow_idle/deny_idle support in clkops Paul Walmsley
2011-02-13 0:25 ` Paul Walmsley
2011-02-14 12:23 ` Rajendra Nayak
2011-02-14 16:50 ` Paul Walmsley
2011-02-13 1:17 ` [PATCH v2 0/7] clock/dpll autoidle support Paul Walmsley
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=1297329400-5936-2-git-send-email-rnayak@ti.com \
--to=rnayak@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).