diff options
author | Devin Heitmueller <dheitmueller@kernellabs.com> | 2009-10-13 22:44:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:40:48 -0500 |
commit | 760c466c66db40cde5953e93b94ae20c7610fb20 (patch) | |
tree | 9046a9b790ecca6b895c67634dd982f43af417bb /drivers/media/common | |
parent | 36a91879d85396ea6470d3a5bde8287e40b5a0e9 (diff) |
V4L/DVB (13188): xc5000: return an error on tuning attempts if firmware not loaded
Xc5000 tuning attempts shouldn't return zero in the case where the firmware
did not load successfully.
Thanks to Michael Krufky for pointing out this issue.
Cc: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/tuners/xc5000.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index d33bf831e76c..432003dded7c 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c | |||
@@ -633,8 +633,12 @@ static int xc5000_set_params(struct dvb_frontend *fe, | |||
633 | struct xc5000_priv *priv = fe->tuner_priv; | 633 | struct xc5000_priv *priv = fe->tuner_priv; |
634 | int ret; | 634 | int ret; |
635 | 635 | ||
636 | if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) | 636 | if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) { |
637 | xc_load_fw_and_init_tuner(fe); | 637 | if (xc_load_fw_and_init_tuner(fe) != XC_RESULT_SUCCESS) { |
638 | dprintk(1, "Unable to load firmware and init tuner\n"); | ||
639 | return -EINVAL; | ||
640 | } | ||
641 | } | ||
638 | 642 | ||
639 | dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency); | 643 | dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency); |
640 | 644 | ||
@@ -884,8 +888,12 @@ static int xc5000_set_analog_params(struct dvb_frontend *fe, | |||
884 | if (priv->i2c_props.adap == NULL) | 888 | if (priv->i2c_props.adap == NULL) |
885 | return -EINVAL; | 889 | return -EINVAL; |
886 | 890 | ||
887 | if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) | 891 | if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) { |
888 | xc_load_fw_and_init_tuner(fe); | 892 | if (xc_load_fw_and_init_tuner(fe) != XC_RESULT_SUCCESS) { |
893 | dprintk(1, "Unable to load firmware and init tuner\n"); | ||
894 | return -EINVAL; | ||
895 | } | ||
896 | } | ||
889 | 897 | ||
890 | switch (params->mode) { | 898 | switch (params->mode) { |
891 | case V4L2_TUNER_RADIO: | 899 | case V4L2_TUNER_RADIO: |