diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-02-07 05:07:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:41 -0400 |
commit | 89aec3e1baaddeaa5636487f0e23f807eb758168 (patch) | |
tree | a9e7b4fb4636e059328dfd05afef111bbfe8ed5c /Documentation/video4linux/v4l2-framework.txt | |
parent | 8ac05ae3192ce8a71fc84e4a88772cce0c09173c (diff) |
V4L/DVB (10489): doc: use consistent naming conventions for vdev and v4l2_dev.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation/video4linux/v4l2-framework.txt')
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index cc350624237d..73f9b642392b 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -134,7 +134,7 @@ The recommended approach is as follows: | |||
134 | 134 | ||
135 | static atomic_t drv_instance = ATOMIC_INIT(0); | 135 | static atomic_t drv_instance = ATOMIC_INIT(0); |
136 | 136 | ||
137 | static int __devinit drv_probe(struct pci_dev *dev, | 137 | static int __devinit drv_probe(struct pci_dev *pdev, |
138 | const struct pci_device_id *pci_id) | 138 | const struct pci_device_id *pci_id) |
139 | { | 139 | { |
140 | ... | 140 | ... |
@@ -218,7 +218,7 @@ to add new ops and categories. | |||
218 | 218 | ||
219 | A sub-device driver initializes the v4l2_subdev struct using: | 219 | A sub-device driver initializes the v4l2_subdev struct using: |
220 | 220 | ||
221 | v4l2_subdev_init(subdev, &ops); | 221 | v4l2_subdev_init(sd, &ops); |
222 | 222 | ||
223 | Afterwards you need to initialize subdev->name with a unique name and set the | 223 | Afterwards you need to initialize subdev->name with a unique name and set the |
224 | module owner. This is done for you if you use the i2c helper functions. | 224 | module owner. This is done for you if you use the i2c helper functions. |
@@ -226,7 +226,7 @@ module owner. This is done for you if you use the i2c helper functions. | |||
226 | A device (bridge) driver needs to register the v4l2_subdev with the | 226 | A device (bridge) driver needs to register the v4l2_subdev with the |
227 | v4l2_device: | 227 | v4l2_device: |
228 | 228 | ||
229 | int err = v4l2_device_register_subdev(device, subdev); | 229 | int err = v4l2_device_register_subdev(v4l2_dev, sd); |
230 | 230 | ||
231 | This can fail if the subdev module disappeared before it could be registered. | 231 | This can fail if the subdev module disappeared before it could be registered. |
232 | After this function was called successfully the subdev->dev field points to | 232 | After this function was called successfully the subdev->dev field points to |
@@ -234,17 +234,17 @@ the v4l2_device. | |||
234 | 234 | ||
235 | You can unregister a sub-device using: | 235 | You can unregister a sub-device using: |
236 | 236 | ||
237 | v4l2_device_unregister_subdev(subdev); | 237 | v4l2_device_unregister_subdev(sd); |
238 | 238 | ||
239 | Afterwards the subdev module can be unloaded and subdev->dev == NULL. | 239 | Afterwards the subdev module can be unloaded and sd->dev == NULL. |
240 | 240 | ||
241 | You can call an ops function either directly: | 241 | You can call an ops function either directly: |
242 | 242 | ||
243 | err = subdev->ops->core->g_chip_ident(subdev, &chip); | 243 | err = sd->ops->core->g_chip_ident(sd, &chip); |
244 | 244 | ||
245 | but it is better and easier to use this macro: | 245 | but it is better and easier to use this macro: |
246 | 246 | ||
247 | err = v4l2_subdev_call(subdev, core, g_chip_ident, &chip); | 247 | err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); |
248 | 248 | ||
249 | The macro will to the right NULL pointer checks and returns -ENODEV if subdev | 249 | The macro will to the right NULL pointer checks and returns -ENODEV if subdev |
250 | is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is | 250 | is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is |
@@ -252,12 +252,12 @@ NULL, or the actual result of the subdev->ops->core->g_chip_ident ops. | |||
252 | 252 | ||
253 | It is also possible to call all or a subset of the sub-devices: | 253 | It is also possible to call all or a subset of the sub-devices: |
254 | 254 | ||
255 | v4l2_device_call_all(dev, 0, core, g_chip_ident, &chip); | 255 | v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip); |
256 | 256 | ||
257 | Any subdev that does not support this ops is skipped and error results are | 257 | Any subdev that does not support this ops is skipped and error results are |
258 | ignored. If you want to check for errors use this: | 258 | ignored. If you want to check for errors use this: |
259 | 259 | ||
260 | err = v4l2_device_call_until_err(dev, 0, core, g_chip_ident, &chip); | 260 | err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); |
261 | 261 | ||
262 | Any error except -ENOIOCTLCMD will exit the loop with that error. If no | 262 | Any error except -ENOIOCTLCMD will exit the loop with that error. If no |
263 | errors (except -ENOIOCTLCMD) occured, then 0 is returned. | 263 | errors (except -ENOIOCTLCMD) occured, then 0 is returned. |
@@ -505,8 +505,8 @@ There are a few useful helper functions: | |||
505 | 505 | ||
506 | You can set/get driver private data in the video_device struct using: | 506 | You can set/get driver private data in the video_device struct using: |
507 | 507 | ||
508 | void *video_get_drvdata(struct video_device *dev); | 508 | void *video_get_drvdata(struct video_device *vdev); |
509 | void video_set_drvdata(struct video_device *dev, void *data); | 509 | void video_set_drvdata(struct video_device *vdev, void *data); |
510 | 510 | ||
511 | Note that you can safely call video_set_drvdata() before calling | 511 | Note that you can safely call video_set_drvdata() before calling |
512 | video_register_device(). | 512 | video_register_device(). |