summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-03-09 12:30:40 -0400
committerMichael Krufky <mkrufky@linuxtv.org>2008-03-09 12:30:40 -0400
commit463d9d496cf51caabf90b3f64ef602768600bbd1 (patch)
treed0fb5e1d2ea6dacab53d84bf941aa613d10e119e /linux/drivers
parent77f1260396ac05dcdb903682220f22bb7558c878 (diff)
downloadmediapointer-dvb-s2-463d9d496cf51caabf90b3f64ef602768600bbd1.tar.gz
mediapointer-dvb-s2-463d9d496cf51caabf90b3f64ef602768600bbd1.tar.bz2
tuner-simple: fix return value of simple_dvb_configure
From: Michael Krufky <mkrufky@linuxtv.org> simple_dvb_configure returns the actual tuned frequency to its caller, so it must be declared as a u32 rather than an int. As a result, we will return 0 to indicate a failure. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/tuner-simple.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c
index 4ccf45dab..98cfa1b5b 100644
--- a/linux/drivers/media/video/tuner-simple.c
+++ b/linux/drivers/media/video/tuner-simple.c
@@ -815,9 +815,10 @@ static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
}
}
-static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
+static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
const struct dvb_frontend_parameters *params)
{
+ /* This function returns the tuned frequency on success, 0 on error */
struct tuner_simple_priv *priv = fe->tuner_priv;
struct tunertype *tun = priv->tun;
static struct tuner_params *t_params;
@@ -828,7 +829,7 @@ static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL);
ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb);
if (ret < 0)
- return ret;
+ return 0; /* failure */
div = ((frequency + t_params->iffreq) * 62500 + offset +
tun->stepsize/2) / tun->stepsize;
@@ -852,17 +853,14 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
u8 *buf, int buf_len)
{
struct tuner_simple_priv *priv = fe->tuner_priv;
- int ret;
u32 frequency;
if (buf_len < 5)
return -EINVAL;
- ret = simple_dvb_configure(fe, buf+1, params);
- if (ret < 0)
- return ret;
- else
- frequency = ret;
+ frequency = simple_dvb_configure(fe, buf+1, params);
+ if (frequency == 0)
+ return -EINVAL;
buf[0] = priv->i2c_props.addr;