Skip to content

Commit f4ffe98

Browse files
committed
drivers: video: mcux_smartdma: Don't set_format() in get_format()
Do not set_format() when doing get_format(). This design seems initially to simplify the sample (just get_format() and everything works out of the box) but it makes thing incomprehensive and error prone. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent e065356 commit f4ffe98

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/video/video_mcux_smartdma.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,7 @@ static int nxp_video_sdma_get_format(const struct device *dev,
292292
if ((fmt->pixelformat != fmts[0].pixelformat) ||
293293
(fmt->width != fmts[0].width_min) ||
294294
(fmt->height != fmts[0].height_min)) {
295-
/* Update format of sensor */
296-
fmt->pixelformat = fmts[0].pixelformat;
297-
fmt->width = fmts[0].width_min;
298-
fmt->height = fmts[0].height_min;
299-
fmt->pitch = fmts[0].width_min * 2;
300-
ret = video_set_format(config->sensor_dev, VIDEO_EP_OUT, fmt);
301-
if (ret < 0) {
302-
LOG_ERR("Sensor device does not support RGB565");
303-
return ret;
304-
}
295+
return -ENOTSUP;
305296
}
306297

307298
fmt->pitch = fmt->width * video_bits_per_pixel(fmt->pixelformat) / BITS_PER_BYTE;

0 commit comments

Comments
 (0)