Skip to content

Commit

Permalink
sh: Tidy up pre-clkdev clk_get() error handling.
Browse files Browse the repository at this point in the history
clk_get() used to return NULL or an errno value depending on whether a
clkdev lookup failed or a clock wasn't found in the primary clock list.
As these disjoint paths were unified and everything now is handled via
clkdev lookups, the NULL case never makes it out of clk_get(). Update
accordingly and always look to the errno value.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Jun 24, 2011
1 parent 225ca45 commit 7912825
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion arch/sh/boards/board-apsh4a3a.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static int apsh4a3a_clk_init(void)
int ret;

clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk))
if (IS_ERR(clk))
return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333000);
clk_put(clk);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/board-apsh4ad0a.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int apsh4ad0a_clk_init(void)
int ret;

clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk))
if (IS_ERR(clk))
return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333000);
clk_put(clk);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/board-sh7785lcr.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static int sh7785lcr_clk_init(void)
int ret;

clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk))
if (IS_ERR(clk))
return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333333);
clk_put(clk);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/board-urquell.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ static int urquell_clk_init(void)
return -EINVAL;

clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk))
if (IS_ERR(clk))
return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333333);
clk_put(clk);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/mach-sdk7786/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ static int sdk7786_clk_init(void)
return -EINVAL;

clk = clk_get(NULL, "extal");
if (!clk || IS_ERR(clk))
if (IS_ERR(clk))
return PTR_ERR(clk);
ret = clk_set_rate(clk, 33333333);
clk_put(clk);
Expand Down

0 comments on commit 7912825

Please sign in to comment.