Skip to content

Commit 9695574

Browse files
Alain Volmatdkalowsk
authored andcommitted
video: gc2145: set default fmt at variable declaration
Set the default format at the moment of variable declaration in gc2145_init function. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
1 parent 28e1246 commit 9695574

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/video/gc2145.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,12 @@ static int gc2145_init_controls(const struct device *dev)
12111211

12121212
static int gc2145_init(const struct device *dev)
12131213
{
1214-
struct video_format fmt;
1214+
/* set default/init format VGA RGB565 */
1215+
struct video_format fmt = {
1216+
.pixelformat = VIDEO_PIX_FMT_RGB565,
1217+
.width = RESOLUTION_VGA_W,
1218+
.height = RESOLUTION_VGA_H,
1219+
};
12151220
int ret;
12161221
const struct gc2145_config *cfg = dev->config;
12171222
(void) cfg;
@@ -1250,11 +1255,6 @@ static int gc2145_init(const struct device *dev)
12501255
return ret;
12511256
}
12521257

1253-
/* set default/init format VGA RGB565 */
1254-
fmt.pixelformat = VIDEO_PIX_FMT_RGB565;
1255-
fmt.width = RESOLUTION_VGA_W;
1256-
fmt.height = RESOLUTION_VGA_H;
1257-
12581258
ret = gc2145_set_fmt(dev, &fmt);
12591259
if (ret) {
12601260
LOG_ERR("Unable to configure default format");

0 commit comments

Comments
 (0)