summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-02-15 11:33:41 +0800
committerHeiko Stuebner <heiko@sntech.de>2016-02-15 23:37:27 +0100
commit022dce0bd03905251de6cdd491a292818eaf3b89 (patch)
treecdafbf19ef651ab6c5f4f38808bc632a72d7cfba /drivers/clk
parentddd02e145611d1689e5014e79d7f37dcd323b70b (diff)
downloadtalos-obmc-linux-022dce0bd03905251de6cdd491a292818eaf3b89.tar.gz
talos-obmc-linux-022dce0bd03905251de6cdd491a292818eaf3b89.zip
clk: rockchip: don't return NULL when registering mmc branch fails
Avoid return NULL if rockchip_clk_register_mmc fails, otherwise rockchip_clk_register_branches print "unknown clock type". The acutal case is that it's a known clock type but we fail to regiser it, which may makes user confuse the reason of failure. Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/rockchip/clk-mmc-phase.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/clk/rockchip/clk-mmc-phase.c b/drivers/clk/rockchip/clk-mmc-phase.c
index 2685644826a0..e0dc7e83403a 100644
--- a/drivers/clk/rockchip/clk-mmc-phase.c
+++ b/drivers/clk/rockchip/clk-mmc-phase.c
@@ -150,7 +150,7 @@ struct clk *rockchip_clk_register_mmc(const char *name,
mmc_clock = kmalloc(sizeof(*mmc_clock), GFP_KERNEL);
if (!mmc_clock)
- return NULL;
+ return ERR_PTR(-ENOMEM);
init.name = name;
init.num_parents = num_parents;
@@ -172,11 +172,7 @@ struct clk *rockchip_clk_register_mmc(const char *name,
clk = clk_register(NULL, &mmc_clock->hw);
if (IS_ERR(clk))
- goto err_free;
+ kfree(mmc_clock);
return clk;
-
-err_free:
- kfree(mmc_clock);
- return NULL;
}
OpenPOWER on IntegriCloud