diff options
author | Shawn Lin <shawn.lin@rock-chips.com> | 2016-02-14 22:33:33 -0500 |
---|---|---|
committer | Heiko Stuebner <heiko@sntech.de> | 2016-02-15 17:35:20 -0500 |
commit | ddd02e145611d1689e5014e79d7f37dcd323b70b (patch) | |
tree | 8a19b9b24545feefb15d4ebd5756c5447f6f33f1 | |
parent | eb4e10c61ddb513dae6508a16eedd2da59effb98 (diff) |
clk: rockchip: don't return NULL when registering inverter fails
Avoid return NULL if rockchip_clk_register_inverter 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>
-rw-r--r-- | drivers/clk/rockchip/clk-inverter.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/clk/rockchip/clk-inverter.c b/drivers/clk/rockchip/clk-inverter.c index 7cbf43beb3c6..dcb6e37f3da1 100644 --- a/drivers/clk/rockchip/clk-inverter.c +++ b/drivers/clk/rockchip/clk-inverter.c | |||
@@ -90,7 +90,7 @@ struct clk *rockchip_clk_register_inverter(const char *name, | |||
90 | 90 | ||
91 | inv_clock = kmalloc(sizeof(*inv_clock), GFP_KERNEL); | 91 | inv_clock = kmalloc(sizeof(*inv_clock), GFP_KERNEL); |
92 | if (!inv_clock) | 92 | if (!inv_clock) |
93 | return NULL; | 93 | return ERR_PTR(-ENOMEM); |
94 | 94 | ||
95 | init.name = name; | 95 | init.name = name; |
96 | init.num_parents = num_parents; | 96 | init.num_parents = num_parents; |
@@ -106,11 +106,7 @@ struct clk *rockchip_clk_register_inverter(const char *name, | |||
106 | 106 | ||
107 | clk = clk_register(NULL, &inv_clock->hw); | 107 | clk = clk_register(NULL, &inv_clock->hw); |
108 | if (IS_ERR(clk)) | 108 | if (IS_ERR(clk)) |
109 | goto err_free; | 109 | kfree(inv_clock); |
110 | 110 | ||
111 | return clk; | 111 | return clk; |
112 | |||
113 | err_free: | ||
114 | kfree(inv_clock); | ||
115 | return NULL; | ||
116 | } | 112 | } |