提交 760c466c 编写于 作者: D Devin Heitmueller 提交者: Mauro Carvalho Chehab

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: NDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 36a91879
...@@ -633,8 +633,12 @@ static int xc5000_set_params(struct dvb_frontend *fe, ...@@ -633,8 +633,12 @@ static int xc5000_set_params(struct dvb_frontend *fe,
struct xc5000_priv *priv = fe->tuner_priv; struct xc5000_priv *priv = fe->tuner_priv;
int ret; int ret;
if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) {
xc_load_fw_and_init_tuner(fe); if (xc_load_fw_and_init_tuner(fe) != XC_RESULT_SUCCESS) {
dprintk(1, "Unable to load firmware and init tuner\n");
return -EINVAL;
}
}
dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency); dprintk(1, "%s() frequency=%d (Hz)\n", __func__, params->frequency);
...@@ -884,8 +888,12 @@ static int xc5000_set_analog_params(struct dvb_frontend *fe, ...@@ -884,8 +888,12 @@ static int xc5000_set_analog_params(struct dvb_frontend *fe,
if (priv->i2c_props.adap == NULL) if (priv->i2c_props.adap == NULL)
return -EINVAL; return -EINVAL;
if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) if (xc5000_is_firmware_loaded(fe) != XC_RESULT_SUCCESS) {
xc_load_fw_and_init_tuner(fe); if (xc_load_fw_and_init_tuner(fe) != XC_RESULT_SUCCESS) {
dprintk(1, "Unable to load firmware and init tuner\n");
return -EINVAL;
}
}
switch (params->mode) { switch (params->mode) {
case V4L2_TUNER_RADIO: case V4L2_TUNER_RADIO:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册