]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
staging: most: video: remove redundant cleanup in comp_exit()
authorGabriel Rondon <grondon@gmail.com>
Sun, 12 Apr 2026 22:23:18 +0000 (23:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 11:01:51 +0000 (05:01 -0600)
most_deregister_component() already calls disconnect_channel() for
every linked channel via bus_for_each_dev() in core.c, which invokes
comp_disconnect_channel() to remove each entry from the video_devices
list and tear down the V4L2 device.

The manual cleanup loop in comp_exit() duplicates this work and is
guarded by a stale comment claiming that "mostcore currently doesn't
call disconnect_channel() for linked channels" — but the core has
since been fixed to do exactly that.

Remove the redundant manual cleanup loop, the outdated comment, and
the BUG_ON() assertion that checked for a condition that can no longer
occur.

Signed-off-by: Gabriel Rondon <grondon@gmail.com>
Link: https://patch.msgid.link/20260412222318.65045-1-grondon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/video/video.c

index 04351f8ccccf17a8c1018729936032bd69229217..98988b0d933064eee88d15fcfe75c5adb27b7cf9 100644 (file)
@@ -555,29 +555,8 @@ static int __init comp_init(void)
 
 static void __exit comp_exit(void)
 {
-       struct most_video_dev *mdev, *tmp;
-       LIST_HEAD(free_list);
-
-       /*
-        * As the mostcore currently doesn't call disconnect_channel()
-        * for linked channels while we call most_deregister_component()
-        * we simulate this call here.
-        * This must be fixed in core.
-        */
-       spin_lock_irq(&list_lock);
-       list_replace_init(&video_devices, &free_list);
-       spin_unlock_irq(&list_lock);
-
-       list_for_each_entry_safe(mdev, tmp, &free_list, list) {
-               list_del_init(&mdev->list);
-               comp_unregister_videodev(mdev);
-               v4l2_device_disconnect(&mdev->v4l2_dev);
-               v4l2_device_put(&mdev->v4l2_dev);
-       }
-
        most_deregister_configfs_subsys(&comp);
        most_deregister_component(&comp);
-       BUG_ON(!list_empty(&video_devices));
 }
 
 module_init(comp_init);