From df619181631217e3166bb6c7538f981e0272617f Mon Sep 17 00:00:00 2001 From: Devin Heitmueller Date: Tue, 10 Jun 2008 12:34:35 -0300 Subject: V4L/DVB (8017): 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx-dvb.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/media/video/em28xx/em28xx-dvb.c') diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c index 8cf4983..0b2333e 100644 --- a/drivers/media/video/em28xx/em28xx-dvb.c +++ b/drivers/media/video/em28xx/em28xx-dvb.c @@ -382,6 +382,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) { @@ -444,6 +449,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; -- cgit v1.1