summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2023-05-29 11:37:24 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-06-09 15:23:04 +0100
commitc1ee1db3c936c09141020007a11da24660c5393f (patch)
treef3b1c9397ea1a2ba5a24c12a70d13ae551d6f939 /drivers/staging/media
parentb0e880e4a85b87b68a76391cdfd1046f024386ef (diff)
downloadlinux-c1ee1db3c936c09141020007a11da24660c5393f.tar.gz
linux-c1ee1db3c936c09141020007a11da24660c5393f.tar.bz2
linux-c1ee1db3c936c09141020007a11da24660c5393f.zip
media: atomisp: ov2680: Add missing ov2680_calc_mode() call to probe()
Call ov2680_calc_mode() from probe() instead of relying on userspace to make at least one s_fmt call to fill the mode parameters. Link: https://lore.kernel.org/r/20230529103741.11904-5-hdegoede@redhat.com Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r--drivers/staging/media/atomisp/i2c/atomisp-ov2680.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
index cf3f9649928a..b1585b4d2c4d 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
@@ -195,8 +195,10 @@ static void ov2680_fill_format(struct ov2680_dev *sensor,
ov2680_set_bayer_order(sensor, fmt);
}
-static void ov2680_calc_mode(struct ov2680_dev *sensor, int width, int height)
+static void ov2680_calc_mode(struct ov2680_dev *sensor)
{
+ int width = sensor->mode.fmt.width;
+ int height = sensor->mode.fmt.height;
int orig_width = width;
int orig_height = height;
@@ -338,7 +340,7 @@ static int ov2680_set_fmt(struct v4l2_subdev *sd,
return 0;
mutex_lock(&sensor->lock);
- ov2680_calc_mode(sensor, fmt->width, fmt->height);
+ ov2680_calc_mode(sensor);
mutex_unlock(&sensor->lock);
return 0;
}
@@ -660,6 +662,7 @@ static int ov2680_probe(struct i2c_client *client)
}
ov2680_fill_format(sensor, &sensor->mode.fmt, OV2680_NATIVE_WIDTH, OV2680_NATIVE_HEIGHT);
+ ov2680_calc_mode(sensor);
ret = v4l2_async_register_subdev_sensor(&sensor->sd);
if (ret) {