|
@@ -1183,18 +1183,6 @@ void em28xx_wake_i2c(struct em28xx *dev)
|
|
|
static LIST_HEAD(em28xx_devlist);
|
|
|
static DEFINE_MUTEX(em28xx_devlist_mutex);
|
|
|
|
|
|
-/*
|
|
|
- * em28xx_realease_resources()
|
|
|
- * unregisters the v4l2,i2c and usb devices
|
|
|
- * called when the device gets disconected or at module unload
|
|
|
-*/
|
|
|
-void em28xx_remove_from_devlist(struct em28xx *dev)
|
|
|
-{
|
|
|
- mutex_lock(&em28xx_devlist_mutex);
|
|
|
- list_del(&dev->devlist);
|
|
|
- mutex_unlock(&em28xx_devlist_mutex);
|
|
|
-};
|
|
|
-
|
|
|
/*
|
|
|
* Extension interface
|
|
|
*/
|
|
@@ -1245,14 +1233,13 @@ void em28xx_init_extension(struct em28xx *dev)
|
|
|
|
|
|
void em28xx_close_extension(struct em28xx *dev)
|
|
|
{
|
|
|
- struct em28xx_ops *ops = NULL;
|
|
|
+ const struct em28xx_ops *ops = NULL;
|
|
|
|
|
|
mutex_lock(&em28xx_devlist_mutex);
|
|
|
- if (!list_empty(&em28xx_extension_devlist)) {
|
|
|
- list_for_each_entry(ops, &em28xx_extension_devlist, next) {
|
|
|
- if (ops->fini)
|
|
|
- ops->fini(dev);
|
|
|
- }
|
|
|
+ list_for_each_entry(ops, &em28xx_extension_devlist, next) {
|
|
|
+ if (ops->fini)
|
|
|
+ ops->fini(dev);
|
|
|
}
|
|
|
+ list_del(&dev->devlist);
|
|
|
mutex_unlock(&em28xx_devlist_mutex);
|
|
|
}
|