VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Changhuang Liang <changhuang.liang@starfivetech.com> 2023-08-17 16:48:31 +0800 committer: Andy Hu <andy.hu@starfivetech.com> 2023-11-01 15:04:54 +0800 commit: 8e8f8713eb33ae7fe3465a484d1f0d95f526ecbb parent: 43dada4396658351388c90f2391a89f33d29e351
Commit Summary:
media: starfive: isp: Fix enum isp subdev code bug
Diffstat:
1 file changed, 3 insertions, 12 deletions
diff --git a/drivers/media/platform/starfive/v4l2_driver/stf_isp.c b/drivers/media/platform/starfive/v4l2_driver/stf_isp.c
index 0d01a9b59731..8b36e22ef583 100644
--- a/drivers/media/platform/starfive/v4l2_driver/stf_isp.c
+++ b/drivers/media/platform/starfive/v4l2_driver/stf_isp.c
@@ -715,21 +715,11 @@ static int isp_enum_mbus_code(struct v4l2_subdev *sd,
 	struct stf_isp_dev *isp_dev = v4l2_get_subdevdata(sd);
 	const struct isp_format_table *formats;
 
-	if (code->index >= isp_dev->nformats)
+	if (code->index >= isp_dev->formats[code->pad].nfmts)
 		return -EINVAL;
-	if (code->pad == STF_ISP_PAD_SINK) {
-		formats = &isp_dev->formats[code->pad];
-		code->code = formats->fmts[code->index].code;
-	} else {
-		struct v4l2_mbus_framefmt *sink_fmt;
-
-		sink_fmt = __isp_get_format(isp_dev, state, STF_ISP_PAD_SINK,
-					code->which);
 
-		code->code = sink_fmt->code;
-		if (!code->code)
-			return -EINVAL;
-	}
+	formats = &isp_dev->formats[code->pad];
+	code->code = formats->fmts[code->index].code;
 	code->flags = 0;
 
 	return 0;