Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261251
b: refs/heads/master
c: 027fd36
h: refs/heads/master
i:
  261249: 2ef3e75
  261247: 0cc708e
v: v3
  • Loading branch information
Istvan Varga authored and Mauro Carvalho Chehab committed Jul 27, 2011
1 parent 1ee67d8 commit a5bdd48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5272f6b1f423d4ce636dc90f190e245897bdb045
refs/heads/master: 027fd361860e40736c0ad093a8f4194d727afb63
36 changes: 16 additions & 20 deletions trunk/drivers/media/common/tuners/xc4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,21 +1400,8 @@ static int xc4000_sleep(struct dvb_frontend *fe)

static int xc4000_init(struct dvb_frontend *fe)
{
struct xc4000_priv *priv = fe->tuner_priv;
int ret;
dprintk(1, "%s()\n", __func__);

mutex_lock(&priv->lock);
ret = check_firmware(fe, DTV8, 0, priv->if_khz);
mutex_unlock(&priv->lock);
if (ret != XC_RESULT_SUCCESS) {
printk(KERN_ERR "xc4000: Unable to initialise tuner\n");
return -EREMOTEIO;
}

if (debug)
xc_debug_dump(priv);

return 0;
}

Expand Down Expand Up @@ -1511,8 +1498,14 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
instance of the driver has loaded the firmware.
*/

if (xc4000_readreg(priv, XREG_PRODUCT_ID, &id) != XC_RESULT_SUCCESS)
if (instance == 1) {
if (xc4000_readreg(priv, XREG_PRODUCT_ID, &id)
!= XC_RESULT_SUCCESS)
goto fail;
} else {
id = ((priv->cur_fw.type & BASE) != 0 ?
priv->hwmodel : XC_PRODUCT_ID_FW_NOT_LOADED);
}

switch (id) {
case XC_PRODUCT_ID_FW_LOADED:
Expand Down Expand Up @@ -1541,16 +1534,19 @@ struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
memcpy(&fe->ops.tuner_ops, &xc4000_tuner_ops,
sizeof(struct dvb_tuner_ops));

/* FIXME: For now, load the firmware at startup. We will remove this
before the code goes to production... */
mutex_lock(&priv->lock);
check_firmware(fe, DTV8, 0, priv->if_khz);
mutex_unlock(&priv->lock);
if (instance == 1) {
int ret;
mutex_lock(&priv->lock);
ret = xc4000_fwupload(fe);
mutex_unlock(&priv->lock);
if (ret != XC_RESULT_SUCCESS)
goto fail2;
}

return fe;
fail:
mutex_unlock(&xc4000_list_mutex);

fail2:
xc4000_release(fe);
return NULL;
}
Expand Down

0 comments on commit a5bdd48

Please sign in to comment.