<p>Patrick Rudolph has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/29531">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">drivers/spi: Return error in failure case<br><br>In case the function pointer isn't set return an error.<br><br>Change-Id: I9de300f651ac93889dafa7377c876bf5ae2c50cc<br>Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com><br>---<br>M src/drivers/spi/spi_flash.c<br>1 file changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/29531/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c</span><br><span>index cc21ccb..b0b5899 100644</span><br><span>--- a/src/drivers/spi/spi_flash.c</span><br><span>+++ b/src/drivers/spi/spi_flash.c</span><br><span>@@ -448,7 +448,7 @@</span><br><span>   if (!flash->ops->get_write_protection) {</span><br><span>               printk(BIOS_WARNING, "SPI: Write-protection gathering not "</span><br><span>                       "implemented for this vendor.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-             return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+             return -1;</span><br><span>   }</span><br><span> </span><br><span>        return flash->ops->get_write_protection(flash, region);</span><br><span>@@ -473,7 +473,7 @@</span><br><span>  if (!flash->ops->set_write_protection) {</span><br><span>               printk(BIOS_WARNING, "SPI: Setting write-protection is not "</span><br><span>                      "implemented for this vendor.\n");</span><br><span style="color: hsl(0, 100%, 40%);">-             return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+             return -1;</span><br><span>   }</span><br><span> </span><br><span>        ret = flash->ops->set_write_protection(flash, region, non_volatile,</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/29531">change 29531</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/29531"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I9de300f651ac93889dafa7377c876bf5ae2c50cc </div>
<div style="display:none"> Gerrit-Change-Number: 29531 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com> </div>