The attached patch fixes a problem where the em28xx driver will not properly detect more than one adapter when first loaded. Manually unplugging and re-plugging USB adapters gets them detected fine. Tested with 2x em2880-based Hauppauge HVR-950 units. Thanks! Maciej Babinski
# HG changeset patch # User root@xxxxxxxxxxxxxxxxxxx # Date 1197321058 21600 # Node ID cda2432c09b8aafcb5bfe617d8f76045b66e388b # Parent 55d60e988b89ab527a6a091e06cc10d05ad3dab6 multiple em28xx cards detected correctly at driver load From: Maciej Babinski <maciej-v4l@xxxxxxxxxxxxxxxx> Signed-off-by: Maciej Babinski <maciej-v4l@xxxxxxxxxxxxxxxx> diff -r 55d60e988b89 -r cda2432c09b8 linux/drivers/media/video/em28xx/em28xx-video.c --- a/linux/drivers/media/video/em28xx/em28xx-video.c Fri Oct 12 01:03:30 2007 +0200 +++ b/linux/drivers/media/video/em28xx/em28xx-video.c Mon Dec 10 15:10:58 2007 -0600 @@ -3185,14 +3185,16 @@ int em28xx_register_extension(struct em2 struct em28xx *h, *dev=NULL; struct list_head *list; - list_for_each(list,&em28xx_devlist) { - h = list_entry(list, struct em28xx, devlist); - dev = h; - } mutex_lock(&em28xx_extension_devlist_lock); list_add_tail(&ops->next,&em28xx_extension_devlist); - if(dev) - ops->init(dev); + + list_for_each(list,&em28xx_devlist) { + dev = list_entry(list, struct em28xx, devlist); + + if(dev) + ops->init(dev); + } + printk("Em28xx: Initialized (%s) extension\n",ops->name); mutex_unlock(&em28xx_extension_devlist_lock); return 0; @@ -3203,13 +3205,12 @@ void em28xx_unregister_extension(struct struct em28xx *h, *dev=NULL; struct list_head *list; + mutex_lock(&em28xx_extension_devlist_lock); list_for_each(list,&em28xx_devlist) { - h = list_entry(list, struct em28xx, devlist); - dev = h; + dev = list_entry(list, struct em28xx, devlist); + if(dev) + ops->fini(dev); } - if(dev) - ops->fini(dev); - mutex_lock(&em28xx_extension_devlist_lock); printk("Em28xx: Removed (%s) extension\n",ops->name); list_del(&ops->next); mutex_unlock(&em28xx_extension_devlist_lock);
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb