diff mbox

clk: use ERR_CAST() for __clk_create_clk()

Message ID 1468913327-7876-1-git-send-email-yamada.masahiro@socionext.com (mailing list archive)
State Accepted, archived
Delegated to: Stephen Boyd
Headers show

Commit Message

Masahiro Yamada July 19, 2016, 7:28 a.m. UTC
This code is clear enough, but the intention will be even clearer
with this.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd Aug. 13, 2016, 1:17 a.m. UTC | #1
On 07/19, Masahiro Yamada wrote:
> This code is clear enough, but the intention will be even clearer
> with this.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---

Applied to clk-next
diff mbox

Patch

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 2bd00ef..953643f 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2430,7 +2430,7 @@  struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,
 
 	/* This is to allow this function to be chained to others */
 	if (IS_ERR_OR_NULL(hw))
-		return (struct clk *) hw;
+		return ERR_CAST(hw);
 
 	clk = kzalloc(sizeof(*clk), GFP_KERNEL);
 	if (!clk)