[PATCH] dvb: flexcop: fix module refcount handling
Corrected the THIS_MODULE handling for the flexcop-stuff and dvb-usb which
lead to oopses because of misorganized module dependencies.
Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff --git a/drivers/media/dvb/b2c2/flexcop-common.h b/drivers/media/dvb/b2c2/flexcop-common.h
index 79e8581..773d158 100644
--- a/drivers/media/dvb/b2c2/flexcop-common.h
+++ b/drivers/media/dvb/b2c2/flexcop-common.h
@@ -75,6 +75,8 @@
struct i2c_adapter i2c_adap;
struct semaphore i2c_sem;
+ struct module *owner;
+
/* options and status */
int extra_feedcount;
int feedcount;
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c
index 7895209..ed717c0 100644
--- a/drivers/media/dvb/b2c2/flexcop-pci.c
+++ b/drivers/media/dvb/b2c2/flexcop-pci.c
@@ -309,6 +309,7 @@
fc->bus_type = FC_PCI;
fc->dev = &pdev->dev;
+ fc->owner = THIS_MODULE;
/* bus specific part */
fc_pci->pdev = pdev;
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c
index 20db632..0113449 100644
--- a/drivers/media/dvb/b2c2/flexcop-usb.c
+++ b/drivers/media/dvb/b2c2/flexcop-usb.c
@@ -498,6 +498,7 @@
fc->bus_type = FC_USB;
fc->dev = &udev->dev;
+ fc->owner = THIS_MODULE;
/* bus specific part */
fc_usb->udev = udev;
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c
index ad59087..df55e4c 100644
--- a/drivers/media/dvb/b2c2/flexcop.c
+++ b/drivers/media/dvb/b2c2/flexcop.c
@@ -67,7 +67,7 @@
static int flexcop_dvb_init(struct flexcop_device *fc)
{
int ret;
- if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",THIS_MODULE)) < 0) {
+ if ((ret = dvb_register_adapter(&fc->dvb_adapter,"FlexCop Digital TV device",fc->owner)) < 0) {
err("error registering DVB adapter");
return ret;
}