diff options
| author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-09-22 15:59:26 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-03 16:29:16 -0400 |
| commit | 39099d09ae4605003696919d7c3a6e8a96607c4b (patch) | |
| tree | f89d402db0ad2f54c02b58f0ce698f6aafbd679a | |
| parent | 63b4ca23ed2b35742bebf8cb2af49b84b24442c6 (diff) | |
[media] omap3isp: Move *_init_entities() functions to the init/cleanup section
Group all init/cleanup functions together to make the code more
readable.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
| -rw-r--r-- | drivers/media/video/omap3isp/ispccdc.c | 62 | ||||
| -rw-r--r-- | drivers/media/video/omap3isp/ispccp2.c | 112 | ||||
| -rw-r--r-- | drivers/media/video/omap3isp/ispcsi2.c | 84 | ||||
| -rw-r--r-- | drivers/media/video/omap3isp/isppreview.c | 94 | ||||
| -rw-r--r-- | drivers/media/video/omap3isp/ispresizer.c | 90 | ||||
| -rw-r--r-- | drivers/media/video/omap3isp/ispstat.c | 36 |
6 files changed, 239 insertions, 239 deletions
diff --git a/drivers/media/video/omap3isp/ispccdc.c b/drivers/media/video/omap3isp/ispccdc.c index 98804d5f89c2..c30cc59d7032 100644 --- a/drivers/media/video/omap3isp/ispccdc.c +++ b/drivers/media/video/omap3isp/ispccdc.c | |||
| @@ -2152,6 +2152,37 @@ static const struct media_entity_operations ccdc_media_ops = { | |||
| 2152 | .link_setup = ccdc_link_setup, | 2152 | .link_setup = ccdc_link_setup, |
| 2153 | }; | 2153 | }; |
| 2154 | 2154 | ||
| 2155 | void omap3isp_ccdc_unregister_entities(struct isp_ccdc_device *ccdc) | ||
| 2156 | { | ||
| 2157 | v4l2_device_unregister_subdev(&ccdc->subdev); | ||
| 2158 | omap3isp_video_unregister(&ccdc->video_out); | ||
| 2159 | } | ||
| 2160 | |||
| 2161 | int omap3isp_ccdc_register_entities(struct isp_ccdc_device *ccdc, | ||
| 2162 | struct v4l2_device *vdev) | ||
| 2163 | { | ||
| 2164 | int ret; | ||
| 2165 | |||
| 2166 | /* Register the subdev and video node. */ | ||
| 2167 | ret = v4l2_device_register_subdev(vdev, &ccdc->subdev); | ||
| 2168 | if (ret < 0) | ||
| 2169 | goto error; | ||
| 2170 | |||
| 2171 | ret = omap3isp_video_register(&ccdc->video_out, vdev); | ||
| 2172 | if (ret < 0) | ||
| 2173 | goto error; | ||
| 2174 | |||
| 2175 | return 0; | ||
| 2176 | |||
| 2177 | error: | ||
| 2178 | omap3isp_ccdc_unregister_entities(ccdc); | ||
| 2179 | return ret; | ||
| 2180 | } | ||
| 2181 | |||
| 2182 | /* ----------------------------------------------------------------------------- | ||
| 2183 | * ISP CCDC initialisation and cleanup | ||
| 2184 | */ | ||
| 2185 | |||
| 2155 | /* | 2186 | /* |
| 2156 | * ccdc_init_entities - Initialize V4L2 subdev and media entity | 2187 | * ccdc_init_entities - Initialize V4L2 subdev and media entity |
| 2157 | * @ccdc: ISP CCDC module | 2188 | * @ccdc: ISP CCDC module |
| @@ -2204,37 +2235,6 @@ static int ccdc_init_entities(struct isp_ccdc_device *ccdc) | |||
| 2204 | return 0; | 2235 | return 0; |
| 2205 | } | 2236 | } |
| 2206 | 2237 | ||
| 2207 | void omap3isp_ccdc_unregister_entities(struct isp_ccdc_device *ccdc) | ||
| 2208 | { | ||
| 2209 | v4l2_device_unregister_subdev(&ccdc->subdev); | ||
| 2210 | omap3isp_video_unregister(&ccdc->video_out); | ||
| 2211 | } | ||
| 2212 | |||
| 2213 | int omap3isp_ccdc_register_entities(struct isp_ccdc_device *ccdc, | ||
| 2214 | struct v4l2_device *vdev) | ||
| 2215 | { | ||
| 2216 | int ret; | ||
| 2217 | |||
| 2218 | /* Register the subdev and video node. */ | ||
| 2219 | ret = v4l2_device_register_subdev(vdev, &ccdc->subdev); | ||
| 2220 | if (ret < 0) | ||
| 2221 | goto error; | ||
| 2222 | |||
| 2223 | ret = omap3isp_video_register(&ccdc->video_out, vdev); | ||
| 2224 | if (ret < 0) | ||
| 2225 | goto error; | ||
| 2226 | |||
| 2227 | return 0; | ||
| 2228 | |||
| 2229 | error: | ||
| 2230 | omap3isp_ccdc_unregister_entities(ccdc); | ||
| 2231 | return ret; | ||
| 2232 | } | ||
| 2233 | |||
| 2234 | /* ----------------------------------------------------------------------------- | ||
| 2235 | * ISP CCDC initialisation and cleanup | ||
| 2236 | */ | ||
| 2237 | |||
| 2238 | /* | 2238 | /* |
| 2239 | * omap3isp_ccdc_init - CCDC module initialization. | 2239 | * omap3isp_ccdc_init - CCDC module initialization. |
| 2240 | * @dev: Device pointer specific to the OMAP3 ISP. | 2240 | * @dev: Device pointer specific to the OMAP3 ISP. |
diff --git a/drivers/media/video/omap3isp/ispccp2.c b/drivers/media/video/omap3isp/ispccp2.c index b8e0863b194c..883a2825cb41 100644 --- a/drivers/media/video/omap3isp/ispccp2.c +++ b/drivers/media/video/omap3isp/ispccp2.c | |||
| @@ -1032,6 +1032,48 @@ static const struct media_entity_operations ccp2_media_ops = { | |||
| 1032 | }; | 1032 | }; |
| 1033 | 1033 | ||
| 1034 | /* | 1034 | /* |
| 1035 | * omap3isp_ccp2_unregister_entities - Unregister media entities: subdev | ||
| 1036 | * @ccp2: Pointer to ISP CCP2 device | ||
| 1037 | */ | ||
| 1038 | void omap3isp_ccp2_unregister_entities(struct isp_ccp2_device *ccp2) | ||
| 1039 | { | ||
| 1040 | v4l2_device_unregister_subdev(&ccp2->subdev); | ||
| 1041 | omap3isp_video_unregister(&ccp2->video_in); | ||
| 1042 | } | ||
| 1043 | |||
| 1044 | /* | ||
| 1045 | * omap3isp_ccp2_register_entities - Register the subdev media entity | ||
| 1046 | * @ccp2: Pointer to ISP CCP2 device | ||
| 1047 | * @vdev: Pointer to v4l device | ||
| 1048 | * return negative error code or zero on success | ||
| 1049 | */ | ||
| 1050 | |||
| 1051 | int omap3isp_ccp2_register_entities(struct isp_ccp2_device *ccp2, | ||
| 1052 | struct v4l2_device *vdev) | ||
| 1053 | { | ||
| 1054 | int ret; | ||
| 1055 | |||
| 1056 | /* Register the subdev and video nodes. */ | ||
| 1057 | ret = v4l2_device_register_subdev(vdev, &ccp2->subdev); | ||
| 1058 | if (ret < 0) | ||
| 1059 | goto error; | ||
| 1060 | |||
| 1061 | ret = omap3isp_video_register(&ccp2->video_in, vdev); | ||
| 1062 | if (ret < 0) | ||
| 1063 | goto error; | ||
| 1064 | |||
| 1065 | return 0; | ||
| 1066 | |||
| 1067 | error: | ||
| 1068 | omap3isp_ccp2_unregister_entities(ccp2); | ||
| 1069 | return ret; | ||
| 1070 | } | ||
| 1071 | |||
| 1072 | /* ----------------------------------------------------------------------------- | ||
| 1073 | * ISP ccp2 initialisation and cleanup | ||
| 1074 | */ | ||
| 1075 | |||
| 1076 | /* | ||
| 1035 | * ccp2_init_entities - Initialize ccp2 subdev and media entity. | 1077 | * ccp2_init_entities - Initialize ccp2 subdev and media entity. |
| 1036 | * @ccp2: Pointer to ISP CCP2 device | 1078 | * @ccp2: Pointer to ISP CCP2 device |
| 1037 | * return negative error code or zero on success | 1079 | * return negative error code or zero on success |
| @@ -1095,62 +1137,6 @@ static int ccp2_init_entities(struct isp_ccp2_device *ccp2) | |||
| 1095 | } | 1137 | } |
| 1096 | 1138 | ||
| 1097 | /* | 1139 | /* |
| 1098 | * omap3isp_ccp2_unregister_entities - Unregister media entities: subdev | ||
| 1099 | * @ccp2: Pointer to ISP CCP2 device | ||
| 1100 | */ | ||
| 1101 | void omap3isp_ccp2_unregister_entities(struct isp_ccp2_device *ccp2) | ||
| 1102 | { | ||
| 1103 | v4l2_device_unregister_subdev(&ccp2->subdev); | ||
| 1104 | omap3isp_video_unregister(&ccp2->video_in); | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | /* | ||
| 1108 | * omap3isp_ccp2_register_entities - Register the subdev media entity | ||
| 1109 | * @ccp2: Pointer to ISP CCP2 device | ||
| 1110 | * @vdev: Pointer to v4l device | ||
| 1111 | * return negative error code or zero on success | ||
| 1112 | */ | ||
| 1113 | |||
| 1114 | int omap3isp_ccp2_register_entities(struct isp_ccp2_device *ccp2, | ||
| 1115 | struct v4l2_device *vdev) | ||
| 1116 | { | ||
| 1117 | int ret; | ||
| 1118 | |||
| 1119 | /* Register the subdev and video nodes. */ | ||
| 1120 | ret = v4l2_device_register_subdev(vdev, &ccp2->subdev); | ||
| 1121 | if (ret < 0) | ||
| 1122 | goto error; | ||
| 1123 | |||
| 1124 | ret = omap3isp_video_register(&ccp2->video_in, vdev); | ||
| 1125 | if (ret < 0) | ||
| 1126 | goto error; | ||
| 1127 | |||
| 1128 | return 0; | ||
| 1129 | |||
| 1130 | error: | ||
| 1131 | omap3isp_ccp2_unregister_entities(ccp2); | ||
| 1132 | return ret; | ||
| 1133 | } | ||
| 1134 | |||
| 1135 | /* ----------------------------------------------------------------------------- | ||
| 1136 | * ISP ccp2 initialisation and cleanup | ||
| 1137 | */ | ||
| 1138 | |||
| 1139 | /* | ||
