summaryrefslogtreecommitdiff
path: root/drivers/media/tuners/xc5000.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/tuners/xc5000.c')
-rw-r--r--drivers/media/tuners/xc5000.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index 0e7e4fdf9e50..f7a8d05d1758 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -25,7 +25,7 @@
#include <linux/dvb/frontend.h>
#include <linux/i2c.h>
-#include "dvb_frontend.h"
+#include <media/dvb_frontend.h>
#include "xc5000.h"
#include "tuner-i2c.h"
@@ -685,8 +685,8 @@ static void xc_debug_dump(struct xc5000_priv *priv)
(totalgain % 256) * 100 / 256);
if (priv->pll_register_no) {
- xc5000_readreg(priv, priv->pll_register_no, &regval);
- dprintk(1, "*** PLL lock status = 0x%04x\n", regval);
+ if (!xc5000_readreg(priv, priv->pll_register_no, &regval))
+ dprintk(1, "*** PLL lock status = 0x%04x\n", regval);
}
}
@@ -831,15 +831,16 @@ static int xc5000_is_firmware_loaded(struct dvb_frontend *fe)
u16 id;
ret = xc5000_readreg(priv, XREG_PRODUCT_ID, &id);
- if (ret == 0) {
+ if (!ret) {
if (id == XC_PRODUCT_ID_FW_NOT_LOADED)
ret = -ENOENT;
else
ret = 0;
+ dprintk(1, "%s() returns id = 0x%x\n", __func__, id);
+ } else {
+ dprintk(1, "%s() returns error %d\n", __func__, ret);
}
- dprintk(1, "%s() returns %s id = 0x%x\n", __func__,
- ret == 0 ? "True" : "False", id);
return ret;
}
@@ -935,7 +936,10 @@ tune_channel:
if (priv->pll_register_no != 0) {
msleep(20);
- xc5000_readreg(priv, priv->pll_register_no, &pll_lock_status);
+ ret = xc5000_readreg(priv, priv->pll_register_no,
+ &pll_lock_status);
+ if (ret)
+ return ret;
if (pll_lock_status > 63) {
/* PLL is unlocked, force reload of the firmware */
dprintk(1, "xc5000: PLL not locked (0x%x). Reloading...\n",
@@ -1190,8 +1194,10 @@ static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe, int force)
}
if (priv->pll_register_no) {
- xc5000_readreg(priv, priv->pll_register_no,
- &pll_lock_status);
+ ret = xc5000_readreg(priv, priv->pll_register_no,
+ &pll_lock_status);
+ if (ret)
+ continue;
if (pll_lock_status > 63) {
/* PLL is unlocked, force reload of the firmware */
printk(KERN_ERR