summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-dvb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-06-10 09:34:35 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-06-10 09:34:35 -0300
commit042fd0f8605186f16b116dc72310b4b4c86b5669 (patch)
treef00f58cc51ed18cfbdd356afc4430f438cd67c0e /linux/drivers/media/video/em28xx/em28xx-dvb.c
parent15d2536093622fb5634677282a682baeadd6146f (diff)
downloadmediapointer-dvb-s2-042fd0f8605186f16b116dc72310b4b4c86b5669.tar.gz
mediapointer-dvb-s2-042fd0f8605186f16b116dc72310b4b4c86b5669.tar.bz2
From: Devin Heitmueller <devin.heitmueller@gmail.com>
Ensure em28xx extensions only get run against devs that support them em28xx-audio.c em28xx-dvb.c - Em28xx extensions should ensure they are being only loaded against devices that support them. Deals with case where there are multiple em28xx devices, some of which have DVB (or ALSA) support and some do not. Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-dvb.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-dvb.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-dvb.c b/linux/drivers/media/video/em28xx/em28xx-dvb.c
index c61c764e1..faf561f90 100644
--- a/linux/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/linux/drivers/media/video/em28xx/em28xx-dvb.c
@@ -423,6 +423,11 @@ static int dvb_init(struct em28xx *dev)
int result = 0;
struct em28xx_dvb *dvb;
+ if (!dev->has_dvb) {
+ /* This device does not support the extension */
+ return 0;
+ }
+
dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL);
if (dvb == NULL) {
@@ -499,6 +504,11 @@ out_free:
static int dvb_fini(struct em28xx *dev)
{
+ if (!dev->has_dvb) {
+ /* This device does not support the extension */
+ return 0;
+ }
+
if (dev->dvb) {
unregister_dvb(dev->dvb);
dev->dvb = NULL;