media: mt9p031: Drop bogus v4l2_subdev_get_try_crop() call from mt9p031_init_cfg()
PATCH 1/1 media: mt9p031: Drop bogus v4l2_subdev_get_try_crop() call from mt9p031_init_cfg()
The mt9p031_init_cfg() already calls __mt9p031_get_pad_crop(), which correctly calls v4l2_subdev_get_try_crop() on V4L2_SUBDEV_FORMAT_TRY or returns &mt9p031->crop on V4L2_SUBDEV_FORMAT_ACTIVE. No need to call v4l2_subdev_get_try_crop() in mt9p031_init_cfg() again in case of both V4L2_SUBDEV_FORMAT_TRY and V4L2_SUBDEV_FORMAT_ACTIVE.
This also fixes a splat generated by this call since commit2ba3e38517f5a ("media: v4l: subdev: Fail graciously when getting try data for NULL state") because v4l2_subdev_get_try_crop() is called with sd_state = NULL
in mt9p031_init_cfg().
---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Stefan Riedmueller <[email protected]>
--- drivers/media/i2c/mt9p031.c | 1 - 1 file changed, 1 deletion(-)
drivers/media/i2c/mt9p031.c +0 -1
@@ -708,7 +708,6 @@ static int mt9p031_init_cfg(struct v4l2_subdev *subdev,V4L2_SUBDEV_FORMAT_TRY ; crop =__mt9p031_get_pad_crop (mt9p031, sd_state,0 , which); -v4l2_subdev_get_try_crop (subdev, sd_state,0 ); crop->left =MT9P031_COLUMN_START_DEF ; crop->top =MT9P031_ROW_START_DEF ; crop->width =MT9P031_WINDOW_WIDTH_DEF ;
Signature · 1 line
2.35.1
Hi Marek,
Thank you for the patch.
Quoted 6 lines · Marek Vasut
The
mt9p031_init_cfg()already calls__mt9p031_get_pad_crop(), which correctly callsv4l2_subdev_get_try_crop()onV4L2_SUBDEV_FORMAT_TRYor returns&mt9p031->croponV4L2_SUBDEV_FORMAT_ACTIVE. No need to callv4l2_subdev_get_try_crop()inmt9p031_init_cfg()again in case of bothV4L2_SUBDEV_FORMAT_TRYandV4L2_SUBDEV_FORMAT_ACTIVE.
Quoted 7 lines
This also fixes a splat generated by this call since commit
2ba3e38517f5a("media: v4l: subdev: Fail graciously when getting try data for NULL state") becausev4l2_subdev_get_try_crop()is called withsd_state= NULL
inmt9p031_init_cfg().Fixes 69681cd041648 ("media: mt9p031: Move open subdev op init code into init_cfg")Signed-off-by Marek Vasut <[email protected]>
Quoted 21 lines
---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: Stefan Riedmueller <[email protected]>--- drivers/media/i2c/mt9p031.c | 1 - 1 file changed, 1 deletion(-)drivers/media/i2c/mt9p031.c +0
-1@@ -708,7 +708,6 @@ static int mt9p031_init_cfg(struct v4l2_subdev *subdev,V4L2_SUBDEV_FORMAT_TRY ; crop =__mt9p031_get_pad_crop (mt9p031, sd_state,0 , which); -v4l2_subdev_get_try_crop (subdev, sd_state,0 ); crop->left =MT9P031_COLUMN_START_DEF ; crop->top =MT9P031_ROW_START_DEF ; crop->width =MT9P031_WINDOW_WIDTH_DEF ;
Signature · 3 lines
Regards, Laurent Pinchart