diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:45:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:50 -0400 |
commit | a2a7f84b7908c6dba998b43a1ed343aff1d2fd98 (patch) | |
tree | 70a46cfd6cc238d9387081c48892d63d974be88c | |
parent | 26cd8972fb5cf673489005bf9b7d16e6f273422b (diff) |
V4L/DVB (7360): tuner-simple: fix return value of simple_dvb_configure
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/tuner-simple.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c index 5356c8a92413..b95ed1f489a0 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 | ||
791 | static int simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, | 791 | static 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 | ||