}
}
-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;
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;
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;