From 6f2e77bb955771a7b8de80ea519c1e9a82b864dd Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Thu, 4 Aug 2011 04:14:11 -0300 Subject: [PATCH] [media] tm6000: Properly count device usage When the USB device is disconnected, the device usage bit is not cleared properly. This leads to errors when a device is unplugged and replugged several times until all TM6000_MAXBOARDS bits are used and keeps the driver from binding to the device. Signed-off-by: Thierry Reding Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/tm6000/tm6000-cards.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index f247e7e..d2ee18f 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c @@ -1171,7 +1171,7 @@ static int tm6000_usb_probe(struct usb_interface *interface, mutex_init(&dev->usb_lock); /* Increment usage count */ - tm6000_devused |= 1<name, 29, "tm6000 #%d", nr); dev->model = id->driver_info; @@ -1287,7 +1287,7 @@ static int tm6000_usb_probe(struct usb_interface *interface, err: printk(KERN_ERR "tm6000: Error %d while registering\n", rc); - tm6000_devused &= ~(1<devno, &tm6000_devused); kfree(dev); } -- 2.7.4