drivers: gpio_nct38xx_port: Fix checking wrong return

Fix error check for previous function return code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2023-01-20 12:14:33 +02:00 committed by Christopher Friedt
parent 61f89b7b18
commit 63f360c7fc
1 changed files with 3 additions and 2 deletions

View File

@ -112,8 +112,9 @@ static int gpio_nct38xx_pin_config(const struct device *dev, gpio_pin_t pin, gpi
}
/* Set level 0:low 1:high */
nct38xx_reg_read_byte(config->nct38xx_dev, NCT38XX_REG_GPIO_DATA_OUT(config->gpio_port),
&reg);
ret = nct38xx_reg_read_byte(config->nct38xx_dev,
NCT38XX_REG_GPIO_DATA_OUT(config->gpio_port),
&reg);
if (ret < 0) {
goto done;
}