From: Hans Verkuil <hans.verkuil@cisco.com> Date: Wed, 29 May 2013 10:59:57 +0000 (-0300) Subject: [media] v4l2-framework: replace g_chip_ident by g_std in the examples X-Git-Tag: firefly_0821_release~176^2~3573^2~1739 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2249aa5c97a017be4e3b5bb0e9a3ca2d2ed31b27;p=firefly-linux-kernel-4.4.55.git [media] v4l2-framework: replace g_chip_ident by g_std in the examples The framework documentation used the g_chip_ident op as an example. This op has been removed, so replace its use in the examples by the g_std op. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> --- diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index a300b283a1a0..24353ecab197 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt @@ -246,7 +246,6 @@ may be NULL if the subdev driver does not support anything from that category. It looks like this: struct v4l2_subdev_core_ops { - int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); int (*log_status)(struct v4l2_subdev *sd); int (*init)(struct v4l2_subdev *sd, u32 val); ... @@ -346,24 +345,24 @@ Afterwards the subdev module can be unloaded and sd->dev == NULL. You can call an ops function either directly: - err = sd->ops->core->g_chip_ident(sd, &chip); + err = sd->ops->core->g_std(sd, &norm); but it is better and easier to use this macro: - err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); + err = v4l2_subdev_call(sd, core, g_std, &norm); The macro will to the right NULL pointer checks and returns -ENODEV if subdev -is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_chip_ident is -NULL, or the actual result of the subdev->ops->core->g_chip_ident ops. +is NULL, -ENOIOCTLCMD if either subdev->core or subdev->core->g_std is +NULL, or the actual result of the subdev->ops->core->g_std ops. It is also possible to call all or a subset of the sub-devices: - v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip); + v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm); Any subdev that does not support this ops is skipped and error results are ignored. If you want to check for errors use this: - err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); + err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm); Any error except -ENOIOCTLCMD will exit the loop with that error. If no errors (except -ENOIOCTLCMD) occurred, then 0 is returned. diff --git a/Documentation/zh_CN/video4linux/v4l2-framework.txt b/Documentation/zh_CN/video4linux/v4l2-framework.txt index 44c1d934c4e3..0da95dbaef34 100644 --- a/Documentation/zh_CN/video4linux/v4l2-framework.txt +++ b/Documentation/zh_CN/video4linux/v4l2-framework.txt @@ -247,7 +247,6 @@ i2c_client ç»æä½ï¼i2c_set_clientdata() 彿°å¯ç¨äºä¿åä¸ä¸ª v4l2_sub è¿äºç»æä½å®ä¹å¦ä¸ï¼ struct v4l2_subdev_core_ops { - int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); int (*log_status)(struct v4l2_subdev *sd); int (*init)(struct v4l2_subdev *sd, u32 val); ... @@ -337,24 +336,24 @@ subdev->dev åå°±æåäº v4l2_deviceã æ³¨åä¹è®¾å¤åï¼å¯éè¿ä»¥ä¸æ¹å¼ç´æ¥è°ç¨å ¶æä½å½æ°ï¼ - err = sd->ops->core->g_chip_ident(sd, &chip); + err = sd->ops->core->g_std(sd, &norm); ä½ä½¿ç¨å¦ä¸å®ä¼æ¯è¾å®¹æä¸åéï¼ - err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); + err = v4l2_subdev_call(sd, core, g_std, &norm); è¿ä¸ªå®å°ä¼å NULL æéæ£æ¥ï¼å¦æ subdev 为 NULLï¼åè¿å-ENODEVï¼å¦æ -subdev->core æ subdev->core->g_chip_ident 为 NULLï¼åè¿å -ENOIOCTLCMDï¼ -å¦åå°è¿å subdev->ops->core->g_chip_ident ops è°ç¨çå®é ç»æã +subdev->core æ subdev->core->g_std 为 NULLï¼åè¿å -ENOIOCTLCMDï¼ +å¦åå°è¿å subdev->ops->core->g_std ops è°ç¨çå®é ç»æã ææ¶ä¹å¯è½åæ¶è°ç¨æææä¸ç³»åå设å¤çæä¸ªæä½å½æ°ï¼ - v4l2_device_call_all(v4l2_dev, 0, core, g_chip_ident, &chip); + v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm); ä»»ä½ä¸æ¯ææ¤æä½çå设å¤é½ä¼è¢«è·³è¿ï¼å¹¶å¿½ç¥é误è¿åå¼ãä½å¦æä½ éè¦ æ£æ¥åºéç ï¼åå¯ä½¿ç¨å¦ä¸å½æ°ï¼ - err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_chip_ident, &chip); + err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm); é¤ -ENOIOCTLCMD å¤çä»»ä½é误é½ä¼è·³åºå¾ªç¯å¹¶è¿åé误å¼ã妿ï¼é¤ -ENOIOCTLCMD å¤ï¼æ²¡æé误åçï¼åè¿å 0ã