aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <[email protected]>2023-10-02 13:29:22 +0300
committerHans Verkuil <[email protected]>2023-10-07 10:55:48 +0200
commitf00a1572b65a444082fb72488ae3b7ce73065696 (patch)
tree4aa6b6dddea642cf45c9204cd04576af78d6581a
parent77ab9dc8d926bf5a0ce1f6dde14c0bb29c473426 (diff)
media: ccs: Obtain media bus formats before initialising up sub-devices
The available mbus codes will soon be needed earlier, at the time sub-devices are initialisaed. This is due to calling init_cfg() op via the v4l2_subdev_init_finalize(). Move ccs_get_mbus_formats() before ccs_init_subdev() calls. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
-rw-r--r--drivers/media/i2c/ccs/ccs-core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index e2669e9299ab..422fb6a4a907 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -3553,6 +3553,12 @@ static int ccs_probe(struct i2c_client *client)
sensor->pll.ext_clk_freq_hz = sensor->hwcfg.ext_clk;
sensor->pll.scale_n = CCS_LIM(sensor, SCALER_N_MIN);
+ rval = ccs_get_mbus_formats(sensor);
+ if (rval) {
+ rval = -ENODEV;
+ goto out_cleanup;
+ }
+
rval = ccs_init_subdev(sensor, sensor->scaler, " scaler", 2,
MEDIA_ENT_F_PROC_VIDEO_SCALER);
if (rval)
@@ -3574,12 +3580,6 @@ static int ccs_probe(struct i2c_client *client)
if (rval)
goto out_cleanup;
- rval = ccs_get_mbus_formats(sensor);
- if (rval) {
- rval = -ENODEV;
- goto out_cleanup;
- }
-
rval = ccs_init_late_controls(sensor);
if (rval) {
rval = -ENODEV;