Commit 059c9859 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Kalle Valo

wl18xx: add checks on wl18xx_top_reg_write() return value

Check return value from call to wl18xx_top_reg_write(),
so in case of error jump to goto label out and return.

Also, remove unnecessary value check before goto label out.

Addresses-Coverity-ID: 1226938
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 69551f5f
...@@ -793,9 +793,13 @@ static int wl18xx_set_clk(struct wl1271 *wl) ...@@ -793,9 +793,13 @@ static int wl18xx_set_clk(struct wl1271 *wl)
ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_P_FACTOR_CFG_2, ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_P_FACTOR_CFG_2,
(wl18xx_clk_table[clk_freq].p >> 16) & (wl18xx_clk_table[clk_freq].p >> 16) &
PLLSH_WCS_PLL_P_FACTOR_CFG_2_MASK); PLLSH_WCS_PLL_P_FACTOR_CFG_2_MASK);
if (ret < 0)
goto out;
} else { } else {
ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_SWALLOW_EN, ret = wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_SWALLOW_EN,
PLLSH_WCS_PLL_SWALLOW_EN_VAL2); PLLSH_WCS_PLL_SWALLOW_EN_VAL2);
if (ret < 0)
goto out;
} }
/* choose WCS PLL */ /* choose WCS PLL */
...@@ -819,8 +823,6 @@ static int wl18xx_set_clk(struct wl1271 *wl) ...@@ -819,8 +823,6 @@ static int wl18xx_set_clk(struct wl1271 *wl)
/* reset the swallowing logic */ /* reset the swallowing logic */
ret = wl18xx_top_reg_write(wl, PLLSH_COEX_PLL_SWALLOW_EN, ret = wl18xx_top_reg_write(wl, PLLSH_COEX_PLL_SWALLOW_EN,
PLLSH_COEX_PLL_SWALLOW_EN_VAL2); PLLSH_COEX_PLL_SWALLOW_EN_VAL2);
if (ret < 0)
goto out;
out: out:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment