From: Hans Verkuil Date: Thu, 15 Jan 2009 09:09:05 +0000 (-0300) Subject: V4L/DVB (10252): v4l2 doc: explain why v4l2_device_unregister_subdev() has to be... X-Git-Tag: v2.6.30-rc1~621^2~694 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f5360bdc5539ccd7644df7acf27e8c740ba8cf6e;p=karo-tx-linux.git V4L/DVB (10252): v4l2 doc: explain why v4l2_device_unregister_subdev() has to be called. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index ff124374e9ba..cc350624237d 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt @@ -340,6 +340,12 @@ Make sure to call v4l2_device_unregister_subdev(sd) when the remove() callback is called. This will unregister the sub-device from the bridge driver. It is safe to call this even if the sub-device was never registered. +You need to do this because when the bridge driver destroys the i2c adapter +the remove() callbacks are called of the i2c devices on that adapter. +After that the corresponding v4l2_subdev structures are invalid, so they +have to be unregistered first. Calling v4l2_device_unregister_subdev(sd) +from the remove() callback ensures that this is always done correctly. + The bridge driver also has some helper functions it can use: