From: Guennadi Liakhovetski Date: Fri, 15 Oct 2010 14:37:24 +0000 (+0000) Subject: sh: fix clk_get() error handling X-Git-Tag: firefly_0821_release~7613^2~3659^2~3 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=56ea510962ec690ede2be2064de72e51a33011d9;p=firefly-linux-kernel-4.4.55.git sh: fix clk_get() error handling clk_get() returns an ERR_PTR(errno) on error and not NULL. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Paul Mundt --- diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 1d7b495a7db4..71a3368ab1fc 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c @@ -1248,14 +1248,14 @@ static int __init arch_setup(void) /* set SPU2 clock to 83.4 MHz */ clk = clk_get(NULL, "spu_clk"); - if (clk) { + if (!IS_ERR(clk)) { clk_set_rate(clk, clk_round_rate(clk, 83333333)); clk_put(clk); } /* change parent of FSI B */ clk = clk_get(NULL, "fsib_clk"); - if (clk) { + if (!IS_ERR(clk)) { clk_register(&fsimckb_clk); clk_set_parent(clk, &fsimckb_clk); clk_set_rate(clk, 11000); @@ -1273,7 +1273,7 @@ static int __init arch_setup(void) /* set VPU clock to 166 MHz */ clk = clk_get(NULL, "vpu_clk"); - if (clk) { + if (!IS_ERR(clk)) { clk_set_rate(clk, clk_round_rate(clk, 166000000)); clk_put(clk); }