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:
parent
a224a9a67a
commit
b0cdc4bce3
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue