Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37342
b: refs/heads/master
c: d995506
h: refs/heads/master
v: v3
  • Loading branch information
Andrew de Quincey authored and Mauro Carvalho Chehab committed Sep 26, 2006
1 parent a20e148 commit 232d71a
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 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: c10d14d62d7b7596fd5c7bb8aad3f2b56f8640e6
refs/heads/master: d995506062c974133ba66d0822e58a923d4d74d9
2 changes: 1 addition & 1 deletion trunk/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ int flexcop_frontend_init(struct flexcop_device *fc)
/* try the air atsc 2nd generation (nxt2002) */
if ((fc->fe = nxt200x_attach(&samsung_tbmv_config, &fc->i2c_adap)) != NULL) {
fc->dev_type = FC_AIR_ATSC2;
dvb_pll_attach(fc->fe, 0x61, &fc->i2c_adap, &dvb_pll_samsung_tbmv);
dvb_attach(dvb_pll_attach, fc->fe, 0x61, &fc->i2c_adap, &dvb_pll_samsung_tbmv);
info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address);
} else
/* try the air atsc 3nd generation (lgdt3303) */
Expand Down
12 changes: 1 addition & 11 deletions trunk/drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1105,17 +1105,7 @@ int dvb_unregister_frontend(struct dvb_frontend* fe)
mutex_lock(&frontend_mutex);
dvb_unregister_device (fepriv->dvbdev);
dvb_frontend_stop (fe);
if (fe->ops.release_sec)
fe->ops.release_sec(fe);
if (fe->ops.tuner_ops.release) {
fe->ops.tuner_ops.release(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
if (fe->ops.release)
fe->ops.release(fe);
else
printk("dvb_frontend: Demodulator (%s) does not have a release callback!\n", fe->ops.info.name);

/* fe is invalid now */
kfree(fepriv);
mutex_unlock(&frontend_mutex);
Expand Down
40 changes: 40 additions & 0 deletions trunk/drivers/media/dvb/dvb-core/dvbdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,44 @@ extern int dvb_usercopy(struct inode *inode, struct file *file,
int (*func)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg));


/** generic DVB attach function. */
#ifdef CONFIG_DVB_CORE_ATTACH
#define dvb_attach(FUNCTION, ARGS...) ({ \
void *__r = NULL; \
typeof(&FUNCTION) __a = symbol_request(FUNCTION); \
if (__a) { \
__r = (void *) __a(ARGS); \
if (__r == NULL) \
symbol_put(FUNCTION); \
} else { \
printk(KERN_ERR "DVB: Unable to find symbol "#FUNCTION"()\n"); \
} \
__r; \
})

#define dvb_detach(FUNCPTR, ARGS...) ({ \
typeof((FUNCPTR)) __funcptrtmp = FUNCPTR; \
if (__funcptrtmp) { \
__funcptrtmp(ARGS); \
symbol_put_addr(__funcptrtmp); \
} \
FUNCPTR = NULL; \
})

#else
#define dvb_attach(FUNCTION, ARGS...) ({ \
FUNCTION(ARGS); \
})

#define dvb_detach(FUNCPTR, ARGS...) \
do { \
if (FUNCPTR) \
FUNCPTR(ARGS); \
FUNCPTR = NULL; \
} while(0)

#endif


#endif /* #ifndef _DVBDEV_H_ */

0 comments on commit 232d71a

Please sign in to comment.