drivers: spi_shim: add return value check

Add function return value check. This was caught by
Coverity.

Coverity-CID: 157124

Change-Id: I93b23325d657dc787300908b9117b6976617fdba
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
This commit is contained in:
Baohong Liu 2016-12-02 12:25:34 -08:00 committed by Anas Nashif
commit b0cdc4bce3

View file

@ -229,8 +229,13 @@ static struct device *gpio_cs_init(const struct spi_qmsi_config *config)
if (!gpio)
return NULL;
gpio_pin_configure(gpio, config->cs_pin, GPIO_DIR_OUT);
gpio_pin_write(gpio, config->cs_pin, 1);
if (gpio_pin_configure(gpio, config->cs_pin, GPIO_DIR_OUT) != 0) {
return NULL;
}
if (gpio_pin_write(gpio, config->cs_pin, 1) != 0) {
return NULL;
}
return gpio;
}