Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 022dce0b authored by Shawn Lin's avatar Shawn Lin Committed by Heiko Stuebner
Browse files

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: default avatarShawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent ddd02e14
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -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;
}