diff mbox series

media: i2c: imx296: Use v4l2_subdev_get_fmt()

Message ID 20230206224702.6412-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit ef586f262c1c86c3a1a649a6419dc2e0ac1136d1
Headers show
Series media: i2c: imx296: Use v4l2_subdev_get_fmt() | expand

Commit Message

Laurent Pinchart Feb. 6, 2023, 10:47 p.m. UTC
The imx296 driver uses the subdev active state, there's no need to
implement the .get_fmt() operation manually. Use the
v4l2_subdev_get_fmt() helper instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/i2c/imx296.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/imx296.c b/drivers/media/i2c/imx296.c
index 3c12b6edeac9..4f22c0515ef8 100644
--- a/drivers/media/i2c/imx296.c
+++ b/drivers/media/i2c/imx296.c
@@ -685,15 +685,6 @@  static int imx296_enum_frame_size(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int imx296_get_format(struct v4l2_subdev *sd,
-			     struct v4l2_subdev_state *state,
-			     struct v4l2_subdev_format *fmt)
-{
-	fmt->format = *v4l2_subdev_get_pad_format(sd, state, fmt->pad);
-
-	return 0;
-}
-
 static int imx296_set_format(struct v4l2_subdev *sd,
 			     struct v4l2_subdev_state *state,
 			     struct v4l2_subdev_format *fmt)
@@ -845,7 +836,7 @@  static const struct v4l2_subdev_video_ops imx296_subdev_video_ops = {
 static const struct v4l2_subdev_pad_ops imx296_subdev_pad_ops = {
 	.enum_mbus_code = imx296_enum_mbus_code,
 	.enum_frame_size = imx296_enum_frame_size,
-	.get_fmt = imx296_get_format,
+	.get_fmt = v4l2_subdev_get_fmt,
 	.set_fmt = imx296_set_format,
 	.get_selection = imx296_get_selection,
 	.set_selection = imx296_set_selection,