LFU-145 imx8qm_val: Fix uninitialized gpio variable
authorYe Li <ye.li@nxp.com>
Mon, 7 Jun 2021 04:42:06 +0000 (21:42 -0700)
committerYe Li <ye.li@nxp.com>
Mon, 7 Jun 2021 05:58:07 +0000 (22:58 -0700)
Fix coverity Issue: 13562326 Uninitialized scalar variable
The flags field of struct gpio_desc is not initialized. When calling
dm_gpio_set_dir_flags, the flags field will be used.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
board/freescale/imx8qm_val/imx8qm_val.c

index f5c0db6..376d633 100644 (file)
@@ -264,6 +264,7 @@ static void board_gpio_init(void)
 
        desc.dev = dev;
        desc.offset = 12;
+       desc.flags = 0;
 
        ret = dm_gpio_request(&desc, "ioexp_rst");
        if (ret) {