Skip to content

drivers: video: fix uninitialized struct in ov2640_init() #92151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions drivers/video/ov2640.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,8 +1000,13 @@ static int ov2640_init_controls(const struct device *dev)

static int ov2640_init(const struct device *dev)
{
struct video_format fmt;
int ret = 0;
/* set default/init format SVGA RGB565 */
struct video_format fmt = {
.pixelformat = VIDEO_PIX_FMT_RGB565,
.width = SVGA_HSIZE,
.height = SVGA_VSIZE,
};

#if DT_INST_NODE_HAS_PROP(0, reset_gpios)
const struct ov2640_config *cfg = dev->config;
Expand All @@ -1028,10 +1033,6 @@ static int ov2640_init(const struct device *dev)

ov2640_write_all(dev, default_regs, ARRAY_SIZE(default_regs));

/* set default/init format SVGA RGB565 */
fmt.pixelformat = VIDEO_PIX_FMT_RGB565;
fmt.width = SVGA_HSIZE;
fmt.height = SVGA_VSIZE;
ret = ov2640_set_fmt(dev, &fmt);
if (ret) {
LOG_ERR("Unable to configure default format");
Expand Down