media: i2c: ov8856: fix debug message to report actual CSI-2 lane count
Subsystems (4)
PATCH v4 2/2 media: i2c: ov8856: fix debug message to report actual CSI-2 lane count
The driver currently prints the number of data lanes using ov8856->cur_mode->data_lanes in ov8856_get_hwcfg(). However, the ov8856->cur_mode structure is not assigned to a clearly supported mode at that point. Due to the missing pointer, enabling dynamic debug may lead to a kernel panic.
Instead, the correct number of CSI-2 data lanes should be taken from bus_cfg.bus.mipi_csi2.num_data_lanes, which represents the real hardware configuration determined at runtime.
Fixes c492ec9ae9ed ("media: ov8856: Add support for 2 data lanes")
Signed-off-by Serin Yeh <[email protected]>
Reviewed-by Kieran Bingham <[email protected]>
--- drivers/media/i2c/ov8856.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/i2c/ov8856.c +2 -1
@@ -2318,7 +2318,8 @@ static int ov8856_get_hwcfg(struct ov8856 *ov8856) goto check_hwcfg_error; } -dev_dbg (dev,"Using %u data lanes\n" , ov8856->cur_mode->data_lanes); +dev_dbg (dev,"Using %u data lanes\n" , + bus_cfg.bus.mipi_csi2.num_data_lanes);if (bus_cfg.bus.mipi_csi2.num_data_lanes ==2 ) ov8856->priv_lane = &lane_cfg_2;
Signature · 1 line
2.25.1