Skip to contentSkip to conversation

media: video-i2c: use vb2_video_unregister_device on driver removal

PATCH New Arash Golgol 1 participant 1 message May 9

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: video-i2c: use vb2_video_unregister_device on driver removal

The driver uses vb2_fop_release() as its file release operation, so vb2_video_unregister_device() should be used instead of video_unregister_device() during driver removal.

This ensures that the vb2 queue is properly disconnected before the video device is unregistered.

---
 drivers/media/i2c/video-i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/video-i2c.c +1 -1
index b2db0dd64a5d..5e11758ffa56 100644
@@ -888,7 +888,7 @@ static void video_i2c_remove(struct i2c_client *client)
 	if (data->chip->set_power)
 		data->chip->set_power(data, false);
 
-	video_unregister_device(&data->vdev);
+	vb2_video_unregister_device(&data->vdev);
 }
 
 #ifdef CONFIG_PM
Signature · 1 line
2.34.1