summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2007-06-14 17:19:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2007-06-14 17:19:59 -0300
commit94558adfeb72462a181b3558e692d53d85a19f12 (patch)
tree9328fe058953c3f7ef5784e9433563b453367e51
parenta6abaa333259a9d636720762d2aef33727eaf602 (diff)
downloadmediapointer-dvb-s2-94558adfeb72462a181b3558e692d53d85a19f12.tar.gz
mediapointer-dvb-s2-94558adfeb72462a181b3558e692d53d85a19f12.tar.bz2
Fix module load/unload
From: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Michel Ludwig <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--linux/drivers/staging/tm6000/tm6000-cards.c4
-rw-r--r--linux/drivers/staging/tm6000/tm6000-video.c11
2 files changed, 7 insertions, 8 deletions
diff --git a/linux/drivers/staging/tm6000/tm6000-cards.c b/linux/drivers/staging/tm6000/tm6000-cards.c
index abac65976..d90bb6270 100644
--- a/linux/drivers/staging/tm6000/tm6000-cards.c
+++ b/linux/drivers/staging/tm6000/tm6000-cards.c
@@ -237,6 +237,7 @@ static int tm6000_usb_probe(struct usb_interface *interface,
/* Increment usage count */
tm6000_devused|=1<<nr;
+ INIT_LIST_HEAD(&dev->tm6000_corelist);
dev->udev= usbdev;
dev->model=id->driver_info;
snprintf(dev->name, 29, "tm6000 #%d", nr);
@@ -374,8 +375,6 @@ static void tm6000_usb_disconnect(struct usb_interface *interface)
if (!dev)
return;
- tm6000_i2c_unregister(dev);
-
printk("tm6000: disconnecting %s\n", dev->name);
mutex_lock(&dev->lock);
@@ -389,6 +388,7 @@ static void tm6000_usb_disconnect(struct usb_interface *interface)
dev->state |= DEV_DISCONNECTED;
mutex_unlock(&dev->lock);
+ kfree(dev);
}
static struct usb_driver tm6000_usb_driver = {
diff --git a/linux/drivers/staging/tm6000/tm6000-video.c b/linux/drivers/staging/tm6000/tm6000-video.c
index 73d8ea97a..4606e0b94 100644
--- a/linux/drivers/staging/tm6000/tm6000-video.c
+++ b/linux/drivers/staging/tm6000/tm6000-video.c
@@ -1589,15 +1589,14 @@ int tm6000_v4l2_register(struct tm6000_core *dev)
int tm6000_v4l2_unregister(struct tm6000_core *dev)
{
struct tm6000_core *h;
- struct list_head *list;
+ struct list_head *pos, *tmp;
- while (!list_empty(&tm6000_corelist)) {
- list = tm6000_corelist.next;
- h = list_entry(list, struct tm6000_core, tm6000_corelist);
+ video_unregister_device(&dev->vfd);
+
+ list_for_each_safe(pos, tmp, &tm6000_corelist) {
+ h = list_entry(pos, struct tm6000_core, tm6000_corelist);
if (h == dev) {
- video_unregister_device(&dev->vfd);
list_del(list);
- kfree (h);
}
}