summaryrefslogtreecommitdiffstats
path: root/drivers/clk/ti/clk-dra7-atl.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2014-10-11 11:41:19 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-10-11 11:41:19 -0700
commit4af6600fd793023c01634cca5abfe4a2b707788f (patch)
tree9e3a830d7782512b492011932ddd789d13a900c4 /drivers/clk/ti/clk-dra7-atl.c
parent447a8b858e4bda41c394b1bc7fdbc9dc0bdf44f6 (diff)
parent68da166491655bc54051bf04c78ce648e2e33508 (diff)
downloadop-kernel-dev-4af6600fd793023c01634cca5abfe4a2b707788f.zip
op-kernel-dev-4af6600fd793023c01634cca5abfe4a2b707788f.tar.gz
Merge branch 'next' into for-linus
Prepare second round of input updates for 3.18.
Diffstat (limited to 'drivers/clk/ti/clk-dra7-atl.c')
-rw-r--r--drivers/clk/ti/clk-dra7-atl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c
index 4a65b41..af29359 100644
--- a/drivers/clk/ti/clk-dra7-atl.c
+++ b/drivers/clk/ti/clk-dra7-atl.c
@@ -139,9 +139,13 @@ static long atl_clk_round_rate(struct clk_hw *hw, unsigned long rate,
static int atl_clk_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long parent_rate)
{
- struct dra7_atl_desc *cdesc = to_atl_desc(hw);
+ struct dra7_atl_desc *cdesc;
u32 divider;
+ if (!hw || !rate)
+ return -EINVAL;
+
+ cdesc = to_atl_desc(hw);
divider = ((parent_rate + rate / 2) / rate) - 1;
if (divider > DRA7_ATL_DIVIDER_MASK)
divider = DRA7_ATL_DIVIDER_MASK;
OpenPOWER on IntegriCloud