Skip to content

Commit 075ee09

Browse files
ngphibangkartben
authored andcommitted
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 d0eedc5 commit 075ee09

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
@@ -275,16 +275,7 @@ static int nxp_video_sdma_get_format(const struct device *dev, struct video_form
275275
if ((fmt->pixelformat != fmts[0].pixelformat) ||
276276
(fmt->width != fmts[0].width_min) ||
277277
(fmt->height != fmts[0].height_min)) {
278-
/* Update format of sensor */
279-
fmt->pixelformat = fmts[0].pixelformat;
280-
fmt->width = fmts[0].width_min;
281-
fmt->height = fmts[0].height_min;
282-
fmt->pitch = fmts[0].width_min * 2;
283-
ret = video_set_format(config->sensor_dev, fmt);
284-
if (ret < 0) {
285-
LOG_ERR("Sensor device does not support RGB565");
286-
return ret;
287-
}
278+
return -ENOTSUP;
288279
}
289280

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

0 commit comments

Comments
 (0)