Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: fix clk_get() error handling

clk_get() returns an ERR_PTR(errno) on error and not NULL.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Guennadi Liakhovetski and committed by
Paul Mundt
56ea5109 e5690e0d

+3 -3
+3 -3
arch/sh/boards/mach-ecovec24/setup.c
··· 1248 1248 1249 1249 /* set SPU2 clock to 83.4 MHz */ 1250 1250 clk = clk_get(NULL, "spu_clk"); 1251 - if (clk) { 1251 + if (!IS_ERR(clk)) { 1252 1252 clk_set_rate(clk, clk_round_rate(clk, 83333333)); 1253 1253 clk_put(clk); 1254 1254 } 1255 1255 1256 1256 /* change parent of FSI B */ 1257 1257 clk = clk_get(NULL, "fsib_clk"); 1258 - if (clk) { 1258 + if (!IS_ERR(clk)) { 1259 1259 clk_register(&fsimckb_clk); 1260 1260 clk_set_parent(clk, &fsimckb_clk); 1261 1261 clk_set_rate(clk, 11000); ··· 1273 1273 1274 1274 /* set VPU clock to 166 MHz */ 1275 1275 clk = clk_get(NULL, "vpu_clk"); 1276 - if (clk) { 1276 + if (!IS_ERR(clk)) { 1277 1277 clk_set_rate(clk, clk_round_rate(clk, 166000000)); 1278 1278 clk_put(clk); 1279 1279 }