[coreboot-gerrit] Change in coreboot[master]: drivers/spi: Return error in failure case

Philipp Deppenwiese (Code Review) gerrit at coreboot.org
Thu Nov 8 12:08:19 CET 2018


Philipp Deppenwiese has submitted this change and it was merged. ( 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 at 9elements.com>
Reviewed-on: https://review.coreboot.org/29531
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
---
M src/drivers/spi/spi_flash.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  build bot (Jenkins): Verified
  Philipp Deppenwiese: Looks good to me, approved



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,

-- 
To view, visit https://review.coreboot.org/29531
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9de300f651ac93889dafa7377c876bf5ae2c50cc
Gerrit-Change-Number: 29531
Gerrit-PatchSet: 2
Gerrit-Owner: Patrick Rudolph <patrick.rudolph at 9elements.com>
Gerrit-Reviewer: David Hendricks <david.hendricks at gmail.com>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181108/f3824597/attachment.html>


More information about the coreboot-gerrit mailing list