diff options
author | Steve Longerbeam <slongerbeam@gmail.com> | 2019-02-20 18:53:32 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-19 13:42:52 -0400 |
commit | dee747f88167124884a918855c1f438e2f7f39e2 (patch) | |
tree | f57997c6b36119ebbdb8bc5a4c9d44626a1f9fb1 /drivers/staging/media/imx/imx-media-internal-sd.c | |
parent | 085b26da62211cb77622008082adff56aefa771d (diff) | |
download | linux-stable-dee747f88167124884a918855c1f438e2f7f39e2.tar.gz linux-stable-dee747f88167124884a918855c1f438e2f7f39e2.tar.bz2 linux-stable-dee747f88167124884a918855c1f438e2f7f39e2.zip |
media: imx: Don't register IPU subdevs/links if CSI port missing
The second IPU internal sub-devices were being registered and links
to them created even when the second IPU is not present. This is wrong
for i.MX6 S/DL and i.MX53 which have only a single IPU.
Fixes: e130291212df5 ("[media] media: Add i.MX media core driver")
Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Cc: stable@vger.kernel.org
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging/media/imx/imx-media-internal-sd.c')
-rw-r--r-- | drivers/staging/media/imx/imx-media-internal-sd.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/staging/media/imx/imx-media-internal-sd.c b/drivers/staging/media/imx/imx-media-internal-sd.c index e620f4adb755..dc510dcfe160 100644 --- a/drivers/staging/media/imx/imx-media-internal-sd.c +++ b/drivers/staging/media/imx/imx-media-internal-sd.c @@ -298,13 +298,14 @@ static int add_internal_subdev(struct imx_media_dev *imxmd, } /* adds the internal subdevs in one ipu */ -static int add_ipu_internal_subdevs(struct imx_media_dev *imxmd, int ipu_id) +int imx_media_add_ipu_internal_subdevs(struct imx_media_dev *imxmd, + int ipu_id) { enum isd_enum i; + int ret; for (i = 0; i < num_isd; i++) { const struct internal_subdev *isd = &int_subdev[i]; - int ret; /* * the CSIs are represented in the device-tree, so those @@ -322,25 +323,10 @@ static int add_ipu_internal_subdevs(struct imx_media_dev *imxmd, int ipu_id) } if (ret) - return ret; + goto remove; } return 0; -} - -int imx_media_add_ipu_internal_subdevs(struct imx_media_dev *imxmd) -{ - int ret; - - ret = add_ipu_internal_subdevs(imxmd, 0); - if (ret) - goto remove; - - ret = add_ipu_internal_subdevs(imxmd, 1); - if (ret) - goto remove; - - return 0; remove: imx_media_remove_ipu_internal_subdevs(imxmd); |