diff options
author | Javier Martinez Canillas <javier@osg.samsung.com> | 2015-12-11 15:16:27 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 12:19:07 -0200 |
commit | b5f6df0607b767fe48b179c6ccee204ee17c3373 (patch) | |
tree | c559c054d1deba85743b1f4c9e29c92cd7e0ab8e /drivers/media/platform/omap3isp/isp.c | |
parent | b3b7a9f138b7539c25e036d398616f6737b08ff7 (diff) | |
download | linux-b5f6df0607b767fe48b179c6ccee204ee17c3373.tar.gz linux-b5f6df0607b767fe48b179c6ccee204ee17c3373.tar.xz |
[media] omap3isp: remove per ISP module link creation functions
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>
Diffstat (limited to 'drivers/media/platform/omap3isp/isp.c')
-rw-r--r-- | drivers/media/platform/omap3isp/isp.c | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index cb8ac90086c1..40aee11805c7 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -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); |