aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/tuner-simple.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index 5356c8a9241..b95ed1f489a 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -788,9 +788,10 @@ static void simple_set_dvb(struct dvb_frontend *fe, u8 *buf,
788 } 788 }
789} 789}
790 790
791static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, 791static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
792 const struct dvb_frontend_parameters *params) 792 const struct dvb_frontend_parameters *params)
793{ 793{
794 /* This function returns the tuned frequency on success, 0 on error */
794 struct tuner_simple_priv *priv = fe->tuner_priv; 795 struct tuner_simple_priv *priv = fe->tuner_priv;
795 struct tunertype *tun = priv->tun; 796 struct tunertype *tun = priv->tun;
796 static struct tuner_params *t_params; 797 static struct tuner_params *t_params;
@@ -801,7 +802,7 @@ static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf,
801 t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL); 802 t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL);
802 ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb); 803 ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb);
803 if (ret < 0) 804 if (ret < 0)
804 return ret; 805 return 0; /* failure */
805 806
806 div = ((frequency + t_params->iffreq) * 62500 + offset + 807 div = ((frequency + t_params->iffreq) * 62500 + offset +
807 tun->stepsize/2) / tun->stepsize; 808 tun->stepsize/2) / tun->stepsize;
@@ -825,17 +826,14 @@ static int simple_dvb_calc_regs(struct dvb_frontend *fe,
825 u8 *buf, int buf_len) 826 u8 *buf, int buf_len)
826{ 827{
827 struct tuner_simple_priv *priv = fe->tuner_priv; 828 struct tuner_simple_priv *priv = fe->tuner_priv;
828 int ret;
829 u32 frequency; 829 u32 frequency;
830 830
831 if (buf_len < 5) 831 if (buf_len < 5)
832 return -EINVAL; 832 return -EINVAL;
833 833
834 ret = simple_dvb_configure(fe, buf+1, params); 834 frequency = simple_dvb_configure(fe, buf+1, params);
835 if (ret < 0) 835 if (frequency == 0)
836 return ret; 836 return -EINVAL;
837 else
838 frequency = ret;
839 837
840 buf[0] = priv->i2c_props.addr; 838 buf[0] = priv->i2c_props.addr;
841 839