diff mbox

pflash: Don't try to write protect when writing to flash file

Message ID 1474004655-30659-1-git-send-email-stewart@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

Stewart Smith Sept. 16, 2016, 5:44 a.m. UTC
When we're using a file on the filesystem as the flash device,
we don't need to write protect it when we flash.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 external/pflash/pflash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/external/pflash/pflash.c b/external/pflash/pflash.c
index a036a86c8aba..73eb916cb37b 100644
--- a/external/pflash/pflash.c
+++ b/external/pflash/pflash.c
@@ -878,7 +878,7 @@  int main(int argc, char *argv[])
 	}
 
 	/* Unlock flash (PNOR only) */
-	if ((erase || program || do_clear) && !bmc_flash) {
+	if ((erase || program || do_clear) && !bmc_flash && !flashfilename) {
 		need_relock = arch_flash_set_wrprotect(bl, false);
 		if (need_relock == -1) {
 			fprintf(stderr, "Architecture doesn't support write protection on flash\n");