summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-core/dvbdev.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-07-29 15:41:40 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-07-29 15:41:40 -0300
commit9a9f822910db8450c5478fd7146b5b52088d7aaa (patch)
tree9b588f2096c3b7351e4c127a2c8ffbc8b45a6c55 /linux/drivers/media/dvb/dvb-core/dvbdev.h
parent7272f8f51ed77805115b9716b72ab4b6d3db0049 (diff)
parentf7eb6e544385a7d7a594e4bedb982e39a500a838 (diff)
downloadmediapointer-dvb-s2-9a9f822910db8450c5478fd7146b5b52088d7aaa.tar.gz
mediapointer-dvb-s2-9a9f822910db8450c5478fd7146b5b52088d7aaa.tar.bz2
merge: http://linuxtv.org/hg/~quincy/v4l-dvb-attach
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.h')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.h b/linux/drivers/media/dvb/dvb-core/dvbdev.h
index 1e7c036d5..26e4a9135 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h
@@ -103,4 +103,26 @@ 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; \
+})
+
+#else
+#define dvb_attach(FUNCTION, ARGS...) ({ \
+ FUNCTION(ARGS); \
+})
+
+#endif
+
#endif /* #ifndef _DVBDEV_H_ */