]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
[media] omap3isp: remove per ISP module link creation functions
authorJavier Martinez Canillas <javier@osg.samsung.com>
Fri, 11 Dec 2015 17:16:27 +0000 (15:16 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:19:07 +0000 (12:19 -0200)
The entities to video nodes links were created on separate functions for
each ISP module but since the only thing that these functions do is to
call media_create_pad_link(), there's no need for that indirection level
and all link creation logic can be just inlined in the caller function.

Also, since the only possible failure for the link creation is a memory
allocation, there is no need for error messages since the core already
reports a very verbose message in that case.

Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/omap3isp/isp.c
drivers/media/platform/omap3isp/ispccdc.c
drivers/media/platform/omap3isp/ispccdc.h
drivers/media/platform/omap3isp/ispccp2.c
drivers/media/platform/omap3isp/ispccp2.h
drivers/media/platform/omap3isp/ispcsi2.c
drivers/media/platform/omap3isp/ispcsi2.h
drivers/media/platform/omap3isp/isppreview.c
drivers/media/platform/omap3isp/isppreview.h
drivers/media/platform/omap3isp/ispresizer.c
drivers/media/platform/omap3isp/ispresizer.h

index cb8ac90086c1410dc963550a72c711ba9b75513e..40aee11805c771094522491b013d3425cbc32b4f 100644 (file)
@@ -1940,37 +1940,51 @@ static int isp_create_pads_links(struct isp_device *isp)
 {
        int ret;
 
-       ret = omap3isp_csi2_create_pads_links(isp);
-       if (ret < 0) {
-               dev_err(isp->dev, "CSI2 pads links creation failed\n");
+       /* Create links between entities and video nodes. */
+       ret = media_create_pad_link(
+                       &isp->isp_csi2a.subdev.entity, CSI2_PAD_SOURCE,
+                       &isp->isp_csi2a.video_out.video.entity, 0, 0);
+       if (ret < 0)
                return ret;
-       }
 
-       ret = omap3isp_ccp2_create_pads_links(isp);
-       if (ret < 0) {
-               dev_err(isp->dev, "CCP2 pads links creation failed\n");
+       ret = media_create_pad_link(
+                       &isp->isp_ccp2.video_in.video.entity, 0,
+                       &isp->isp_ccp2.subdev.entity, CCP2_PAD_SINK, 0);
+       if (ret < 0)
                return ret;
-       }
 
-       ret = omap3isp_ccdc_create_pads_links(isp);
-       if (ret < 0) {
-               dev_err(isp->dev, "CCDC pads links creation failed\n");
+       ret = media_create_pad_link(
+                       &isp->isp_ccdc.subdev.entity, CCDC_PAD_SOURCE_OF,
+                       &isp->isp_ccdc.video_out.video.entity, 0, 0);
+       if (ret < 0)
                return ret;
-       }
 
-       ret = omap3isp_preview_create_pads_links(isp);
-       if (ret < 0) {
-               dev_err(isp->dev, "Preview pads links creation failed\n");
+       ret = media_create_pad_link(
+                       &isp->isp_prev.video_in.video.entity, 0,
+                       &isp->isp_prev.subdev.entity, PREV_PAD_SINK, 0);
+       if (ret < 0)
                return ret;
-       }
 
-       ret = omap3isp_resizer_create_pads_links(isp);
-       if (ret < 0) {
-               dev_err(isp->dev, "Resizer pads links creation failed\n");
+       ret = media_create_pad_link(
+                       &isp->isp_prev.subdev.entity, PREV_PAD_SOURCE,
+                       &isp->isp_prev.video_out.video.entity, 0, 0);
+       if (ret < 0)
+               return ret;
+
+       ret = media_create_pad_link(
+                       &isp->isp_res.video_in.video.entity, 0,
+                       &isp->isp_res.subdev.entity, RESZ_PAD_SINK, 0);
+       if (ret < 0)
+               return ret;
+
+       ret = media_create_pad_link(
+                       &isp->isp_res.subdev.entity, RESZ_PAD_SOURCE,
+                       &isp->isp_res.video_out.video.entity, 0, 0);
+
+       if (ret < 0)
                return ret;
-       }
 
-       /* Connect the submodules. */
+       /* Create links between entities. */
        ret = media_create_pad_link(
                        &isp->isp_csi2a.subdev.entity, CSI2_PAD_SOURCE,
                        &isp->isp_ccdc.subdev.entity, CCDC_PAD_SINK, 0);
index 749462c1af8e9dd21bfcf67abc941498546a2158..5e16b5f594b78b7e4b61f2f7d8a71348efd1bcec 100644 (file)
@@ -2717,20 +2717,6 @@ int omap3isp_ccdc_init(struct isp_device *isp)
        return 0;
 }
 
-/*
- * omap3isp_ccdc_create_pads_links - CCDC pads links creation
- * @isp : Pointer to ISP device
- * return negative error code or zero on success
- */
-int omap3isp_ccdc_create_pads_links(struct isp_device *isp)
-{
-       struct isp_ccdc_device *ccdc = &isp->isp_ccdc;
-
-       /* Connect the CCDC subdev to the video node. */
-       return media_create_pad_link(&ccdc->subdev.entity, CCDC_PAD_SOURCE_OF,
-                                    &ccdc->video_out.video.entity, 0, 0);
-}
-
 /*
  * omap3isp_ccdc_cleanup - CCDC module cleanup.
  * @isp: Device pointer specific to the OMAP3 ISP.
index 2128203ef6fb37c3368c5807e7807d5dccccbefe..3440a709794001a68513ba9300e677808b43e401 100644 (file)
@@ -163,7 +163,6 @@ struct isp_ccdc_device {
 struct isp_device;
 
 int omap3isp_ccdc_init(struct isp_device *isp);
-int omap3isp_ccdc_create_pads_links(struct isp_device *isp);
 void omap3isp_ccdc_cleanup(struct isp_device *isp);
 int omap3isp_ccdc_register_entities(struct isp_ccdc_device *ccdc,
        struct v4l2_device *vdev);
index 59686dd1bb0a2bfccbab09538bc06184d4d69d5d..27f5fe4edefcc81f666175c80b355b28e02a25a8 100644 (file)
@@ -1153,20 +1153,6 @@ int omap3isp_ccp2_init(struct isp_device *isp)
        return 0;
 }
 
-/*
- * omap3isp_ccp2_create_pads_links - CCP2 pads links creation
- * @isp : Pointer to ISP device
- * return negative error code or zero on success
- */
-int omap3isp_ccp2_create_pads_links(struct isp_device *isp)
-{
-       struct isp_ccp2_device *ccp2 = &isp->isp_ccp2;
-
-       /* Connect the video node to the ccp2 subdev. */
-       return media_create_pad_link(&ccp2->video_in.video.entity, 0,
-                                    &ccp2->subdev.entity, CCP2_PAD_SINK, 0);
-}
-
 /*
  * omap3isp_ccp2_cleanup - CCP2 un-initialization
  * @isp : Pointer to ISP device
index fb74bc67878b1dabcbe2e1213e9d80a5420ace12..4662bffa79e31a0044e09efe8f09c9042f97869d 100644 (file)
@@ -79,7 +79,6 @@ struct isp_ccp2_device {
 
 /* Function declarations */
 int omap3isp_ccp2_init(struct isp_device *isp);
-int omap3isp_ccp2_create_pads_links(struct isp_device *isp);
 void omap3isp_ccp2_cleanup(struct isp_device *isp);
 int omap3isp_ccp2_register_entities(struct isp_ccp2_device *ccp2,
                        struct v4l2_device *vdev);
index 886f148755b0c9165e13b88d50635249112385a1..f75a1be29d84aa1f8ff63f2a60f557297369989d 100644 (file)
@@ -1310,20 +1310,6 @@ int omap3isp_csi2_init(struct isp_device *isp)
        return 0;
 }
 
-/*
- * omap3isp_csi2_create_pads_links - CSI2 pads links creation
- * @isp : Pointer to ISP device
- * return negative error code or zero on success
- */
-int omap3isp_csi2_create_pads_links(struct isp_device *isp)
-{
-       struct isp_csi2_device *csi2a = &isp->isp_csi2a;
-
-       /* Connect the CSI2 subdev to the video node. */
-       return media_create_pad_link(&csi2a->subdev.entity, CSI2_PAD_SOURCE,
-                                    &csi2a->video_out.video.entity, 0, 0);
-}
-
 /*
  * omap3isp_csi2_cleanup - Routine for module driver cleanup
  */
index 452ee239c7d77fa21774189e339c317a407508ef..453ed62fe3946c7a3dc7fb7cdc2399804fcfc7e1 100644 (file)
@@ -148,7 +148,6 @@ struct isp_csi2_device {
 void omap3isp_csi2_isr(struct isp_csi2_device *csi2);
 int omap3isp_csi2_reset(struct isp_csi2_device *csi2);
 int omap3isp_csi2_init(struct isp_device *isp);
-int omap3isp_csi2_create_pads_links(struct isp_device *isp);
 void omap3isp_csi2_cleanup(struct isp_device *isp);
 void omap3isp_csi2_unregister_entities(struct isp_csi2_device *csi2);
 int omap3isp_csi2_register_entities(struct isp_csi2_device *csi2,
index e15ad4133632b21c1bd113adbe73a0c93d6f0edd..84a96670e2e71483442a584d2bcd124f4f0c6da4 100644 (file)
@@ -2341,26 +2341,6 @@ int omap3isp_preview_init(struct isp_device *isp)
        return preview_init_entities(prev);
 }
 
-/*
- * omap3isp_preview_create_pads_links - Previewer pads links creation
- * @isp : Pointer to ISP device
- * return negative error code or zero on success
- */
-int omap3isp_preview_create_pads_links(struct isp_device *isp)
-{
-       struct isp_prev_device *prev = &isp->isp_prev;
-       int ret;
-
-       /* Connect the video nodes to the previewer subdev. */
-       ret = media_create_pad_link(&prev->video_in.video.entity, 0,
-                       &prev->subdev.entity, PREV_PAD_SINK, 0);
-       if (ret < 0)
-               return ret;
-
-       return media_create_pad_link(&prev->subdev.entity, PREV_PAD_SOURCE,
-                                    &prev->video_out.video.entity, 0, 0);
-}
-
 void omap3isp_preview_cleanup(struct isp_device *isp)
 {
        struct isp_prev_device *prev = &isp->isp_prev;
index f3593b7cecc712bfa9e40d202e9ff8fc4e73b67c..16fdc03a3d43bfb114d3ee64e6a5e04521cb5357 100644 (file)
@@ -148,7 +148,6 @@ struct isp_prev_device {
 struct isp_device;
 
 int omap3isp_preview_init(struct isp_device *isp);
-int omap3isp_preview_create_pads_links(struct isp_device *isp);
 void omap3isp_preview_cleanup(struct isp_device *isp);
 
 int omap3isp_preview_register_entities(struct isp_prev_device *prv,
index 20b98d876d7edd17a71fb4e92e099c2afceb78a7..0b6a87508584f4eb5201f3f2b0bf284c1b7380f7 100644 (file)
@@ -1785,26 +1785,6 @@ int omap3isp_resizer_init(struct isp_device *isp)
        return resizer_init_entities(res);
 }
 
-/*
- * omap3isp_resizer_create_pads_links - Resizer pads links creation
- * @isp : Pointer to ISP device
- * return negative error code or zero on success
- */
-int omap3isp_resizer_create_pads_links(struct isp_device *isp)
-{
-       struct isp_res_device *res = &isp->isp_res;
-       int ret;
-
-       /* Connect the video nodes to the resizer subdev. */
-       ret = media_create_pad_link(&res->video_in.video.entity, 0,
-                                   &res->subdev.entity, RESZ_PAD_SINK, 0);
-       if (ret < 0)
-               return ret;
-
-       return media_create_pad_link(&res->subdev.entity, RESZ_PAD_SOURCE,
-                                    &res->video_out.video.entity, 0, 0);
-}
-
 void omap3isp_resizer_cleanup(struct isp_device *isp)
 {
        struct isp_res_device *res = &isp->isp_res;
index 8b9fdcdab73d8963067f43a215785a70a7ecc3b1..5414542912e2723b39f0ec034293af10ab7c279c 100644 (file)
@@ -119,7 +119,6 @@ struct isp_res_device {
 struct isp_device;
 
 int omap3isp_resizer_init(struct isp_device *isp);
-int omap3isp_resizer_create_pads_links(struct isp_device *isp);
 void omap3isp_resizer_cleanup(struct isp_device *isp);
 
 int omap3isp_resizer_register_entities(struct isp_res_device *res,