diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2014-08-07 08:49:05 -0400 |
---|---|---|
committer | Hans-Christian Egtvedt <egtvedt@samfundet.no> | 2014-08-07 09:28:35 -0400 |
commit | 686913aa9f5179647818813fd2bc8342cf7119c4 (patch) | |
tree | b90dbd58c8b22d1d9dcc675dbfc7cf23d0e740bd /arch/avr32/boards | |
parent | 19583ca584d6f574384e17fe7613dfaeadcdc4a6 (diff) |
avr32: fix error return code
Convert a zero return value on error to a negative one, as returned
elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r-- | arch/avr32/boards/hammerhead/flash.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/avr32/boards/hammerhead/flash.c b/arch/avr32/boards/hammerhead/flash.c index 776c3cb9b6e4..e86280ccd8fa 100644 --- a/arch/avr32/boards/hammerhead/flash.c +++ b/arch/avr32/boards/hammerhead/flash.c | |||
@@ -190,14 +190,19 @@ static int __init hammerhead_usbh_init(void) | |||
190 | 190 | ||
191 | /* setup gclk0 to run from osc1 */ | 191 | /* setup gclk0 to run from osc1 */ |
192 | gclk = clk_get(NULL, "gclk0"); | 192 | gclk = clk_get(NULL, "gclk0"); |
193 | if (IS_ERR(gclk)) | 193 | if (IS_ERR(gclk)) { |
194 | ret = PTR_ERR(gclk); | ||
194 | goto err_gclk; | 195 | goto err_gclk; |
196 | } | ||
195 | 197 | ||
196 | osc = clk_get(NULL, "osc1"); | 198 | osc = clk_get(NULL, "osc1"); |
197 | if (IS_ERR(osc)) | 199 | if (IS_ERR(osc)) { |
200 | ret = PTR_ERR(osc); | ||
198 | goto err_osc; | 201 | goto err_osc; |
202 | } | ||
199 | 203 | ||
200 | if (clk_set_parent(gclk, osc)) { | 204 | ret = clk_set_parent(gclk, osc); |
205 | if (ret < 0) { | ||
201 | pr_debug("hammerhead: failed to set osc1 for USBH clock\n"); | 206 | pr_debug("hammerhead: failed to set osc1 for USBH clock\n"); |
202 | goto err_set_clk; | 207 | goto err_set_clk; |
203 | } | 208 | } |