From: rnayak@ti.com (Rajendra Nayak)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] omap: clock: Check for enable/disable ops support
Date: Tue, 8 Feb 2011 15:40:32 +0530 [thread overview]
Message-ID: <1297159838-30282-2-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1297159838-30282-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-08 10:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-08 10:10 [PATCH 0/7] clock/dpll autoidle support Rajendra Nayak
2011-02-08 10:10 ` Rajendra Nayak [this message]
2011-02-08 10:10 ` [PATCH 2/7] omap3: dpll: Populate clkops for dpll1_ck Rajendra Nayak
2011-02-08 10:10 ` [PATCH 3/7] omap: clock: Add allow_idle/deny_idle support in clkops Rajendra Nayak
2011-02-08 10:10 ` [PATCH 4/7] omap: dpll: Add allow_idle/deny_idle support for all DPLL's Rajendra Nayak
2011-02-08 10:10 ` [PATCH 5/7] omap: dpll: Enable all OMAP3/4 dpll autoidle late at boot Rajendra Nayak
2011-02-08 10:10 ` [PATCH 6/7] omap4: dpll: Add dpll api to control GATE_CTRL Rajendra Nayak
2011-02-08 10:10 ` [PATCH 7/7] omap4: dpll: Enable auto gate control for all MX postdividers Rajendra Nayak
2011-02-12 23:18 ` [PATCH 2/7] omap3: dpll: Populate clkops for dpll1_ck Paul Walmsley
2011-02-12 23:17 ` [PATCH 1/7] omap: clock: Check for enable/disable ops support Paul Walmsley
2011-02-14 12:15 ` Rajendra Nayak
2011-02-14 16:49 ` Paul Walmsley
2011-02-10 8:59 ` [PATCH 0/7] clock/dpll autoidle support Rajendra Nayak
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=1297159838-30282-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).