Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/29531
Change subject: drivers/spi: Return error in failure case ......................................................................
drivers/spi: Return error in failure case
In case the function pointer isn't set return an error.
Change-Id: I9de300f651ac93889dafa7377c876bf5ae2c50cc Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/drivers/spi/spi_flash.c 1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/29531/1
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index cc21ccb..b0b5899 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -448,7 +448,7 @@ if (!flash->ops->get_write_protection) { printk(BIOS_WARNING, "SPI: Write-protection gathering not " "implemented for this vendor.\n"); - return 0; + return -1; }
return flash->ops->get_write_protection(flash, region); @@ -473,7 +473,7 @@ if (!flash->ops->set_write_protection) { printk(BIOS_WARNING, "SPI: Setting write-protection is not " "implemented for this vendor.\n"); - return 0; + return -1; }
ret = flash->ops->set_write_protection(flash, region, non_volatile,