summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChanghuang Liang <changhuang.liang@starfivetech.com>2023-08-17 11:48:31 +0300
committerAndy Hu <andy.hu@starfivetech.com>2023-11-01 10:04:54 +0300
commit8e8f8713eb33ae7fe3465a484d1f0d95f526ecbb (patch)
treeb04c229b7cdb6c04f848c971945bfb7a4dd74f21
parent43dada4396658351388c90f2391a89f33d29e351 (diff)
downloadlinux-8e8f8713eb33ae7fe3465a484d1f0d95f526ecbb.tar.xz
media: starfive: isp: Fix enum isp subdev code bug
Fix enum isp subdev code bug. Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
-rw-r--r--drivers/media/platform/starfive/v4l2_driver/stf_isp.c16
1 files changed, 3 insertions, 13 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;