Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271727
b: refs/heads/master
c: 0b8bd83
h: refs/heads/master
i:
  271725: 9cab823
  271723: df5f9e7
  271719: 44b84a0
  271711: 5eeabcb
v: v3
  • Loading branch information
Chris Rankin authored and Mauro Carvalho Chehab committed Sep 3, 2011
1 parent 8aa13db commit 78d5493
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 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: 76424a0a50982e4026c7d1d5a0cddc92eecc5969
refs/heads/master: 0b8bd83cf393832f1d00096b866d888b75b374c3
2 changes: 1 addition & 1 deletion trunk/drivers/media/common/tuners/tda18271-fe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ static int tda18271_set_config(struct dvb_frontend *fe, void *priv_cfg)
return 0;
}

static struct dvb_tuner_ops tda18271_tuner_ops = {
static const struct dvb_tuner_ops tda18271_tuner_ops = {
.info = {
.name = "NXP TDA18271HD",
.frequency_min = 45000000,
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/media/dvb/frontends/cxd2820r_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ static int cxd2820r_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
return cxd2820r_wr_reg_mask(priv, 0xdb, enable ? 1 : 0, 0x1);
}

static struct dvb_frontend_ops cxd2820r_ops[2];
static const struct dvb_frontend_ops cxd2820r_ops[2];

struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
struct i2c_adapter *i2c, struct dvb_frontend *fe)
Expand Down Expand Up @@ -796,7 +796,7 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
}
EXPORT_SYMBOL(cxd2820r_attach);

static struct dvb_frontend_ops cxd2820r_ops[2] = {
static const struct dvb_frontend_ops cxd2820r_ops[2] = {
{
/* DVB-T/T2 */
.info = {
Expand Down
22 changes: 20 additions & 2 deletions trunk/drivers/media/video/em28xx/em28xx-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,13 @@ static int em28xx_dvb_init(struct em28xx *dev)
goto ret;
}

static inline void prevent_sleep(struct dvb_frontend_ops *ops)
{
ops->set_voltage = NULL;
ops->sleep = NULL;
ops->tuner_ops.sleep = NULL;
}

static int em28xx_dvb_fini(struct em28xx *dev)
{
if (!dev->board.has_dvb) {
Expand All @@ -850,8 +857,19 @@ static int em28xx_dvb_fini(struct em28xx *dev)
}

if (dev->dvb) {
em28xx_unregister_dvb(dev->dvb);
kfree(dev->dvb);
struct em28xx_dvb *dvb = dev->dvb;

if (dev->state & DEV_DISCONNECTED) {
/* We cannot tell the device to sleep
* once it has been unplugged. */
if (dvb->fe[0])
prevent_sleep(&dvb->fe[0]->ops);
if (dvb->fe[1])
prevent_sleep(&dvb->fe[1]->ops);
}

em28xx_unregister_dvb(dvb);
kfree(dvb);
dev->dvb = NULL;
}

Expand Down

0 comments on commit 78d5493

Please sign in to comment.