Commit 7988fc21 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (11789): xc5000: check xc5000_readreg return value for XC_RESULT_SUCCESS

Make return value checking for calls to i2c routines explicit.
Signed-off-by: default avatarDevin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d7800d4e
...@@ -428,7 +428,7 @@ static int xc_get_frequency_error(struct xc5000_priv *priv, u32 *freq_error_hz) ...@@ -428,7 +428,7 @@ static int xc_get_frequency_error(struct xc5000_priv *priv, u32 *freq_error_hz)
u32 tmp; u32 tmp;
result = xc5000_readreg(priv, XREG_FREQ_ERROR, &regData); result = xc5000_readreg(priv, XREG_FREQ_ERROR, &regData);
if (result) if (result != XC_RESULT_SUCCESS)
return result; return result;
tmp = (u32)regData; tmp = (u32)regData;
...@@ -449,7 +449,7 @@ static int xc_get_version(struct xc5000_priv *priv, ...@@ -449,7 +449,7 @@ static int xc_get_version(struct xc5000_priv *priv,
int result; int result;
result = xc5000_readreg(priv, XREG_VERSION, &data); result = xc5000_readreg(priv, XREG_VERSION, &data);
if (result) if (result != XC_RESULT_SUCCESS)
return result; return result;
(*hw_majorversion) = (data >> 12) & 0x0F; (*hw_majorversion) = (data >> 12) & 0x0F;
...@@ -466,7 +466,7 @@ static int xc_get_hsync_freq(struct xc5000_priv *priv, u32 *hsync_freq_hz) ...@@ -466,7 +466,7 @@ static int xc_get_hsync_freq(struct xc5000_priv *priv, u32 *hsync_freq_hz)
int result; int result;
result = xc5000_readreg(priv, XREG_HSYNC_FREQ, &regData); result = xc5000_readreg(priv, XREG_HSYNC_FREQ, &regData);
if (result) if (result != XC_RESULT_SUCCESS)
return result; return result;
(*hsync_freq_hz) = ((regData & 0x0fff) * 763)/100; (*hsync_freq_hz) = ((regData & 0x0fff) * 763)/100;
...@@ -960,7 +960,7 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe, ...@@ -960,7 +960,7 @@ struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
/* Check if firmware has been loaded. It is possible that another /* Check if firmware has been loaded. It is possible that another
instance of the driver has loaded the firmware. instance of the driver has loaded the firmware.
*/ */
if (xc5000_readreg(priv, XREG_PRODUCT_ID, &id) != 0) if (xc5000_readreg(priv, XREG_PRODUCT_ID, &id) != XC_RESULT_SUCCESS)
goto fail; goto fail;
switch (id) { switch (id) {
......
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