Skip to content

Commit

Permalink
sh: fix clk_get() error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guennadi Liakhovetski authored and Paul Mundt committed Oct 18, 2010
1 parent e5690e0 commit 56ea510
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/sh/boards/mach-ecovec24/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 56ea510

Please sign in to comment.