Patchwork [09/10] Add return code to rmmio_vall

login
register
about
Submitter Niklas
Date 2013-09-23 18:27:28
Message ID <1379960849-20585-10-git-send-email-niso@kth.se>
Download mbox | patch
Permalink /patch/4063/
State New
Headers show

Comments

Niklas - 2013-09-23 18:27:28
Signed-off-by: Niklas Söderlund <niso@kth.se>
---
 hwaccess.c   |  3 ++-
 ichspi.c     | 12 ++++++++----
 programmer.h |  2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

Patch

diff --git a/hwaccess.c b/hwaccess.c
index 540c713..8d0c2ad 100644
--- a/hwaccess.c
+++ b/hwaccess.c
@@ -290,7 +290,8 @@  int rmmio_valw(void *addr)
 	return 0;
 }
 
-void rmmio_vall(void *addr)
+int rmmio_vall(void *addr)
 {
 	register_undo_mmio_writel(addr);
+	return 0;
 }
diff --git a/ichspi.c b/ichspi.c
index 8c131a5..30de8c0 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -544,8 +544,10 @@  static int program_opcodes(OPCODES *op, int enable_undo)
 				return 1;
 			if (rmmio_valw(ich_spibar + ICH7_REG_OPTYPE))
 				return 1;
-			rmmio_vall(ich_spibar + ICH7_REG_OPMENU);
-			rmmio_vall(ich_spibar + ICH7_REG_OPMENU + 4);
+			if (rmmio_vall(ich_spibar + ICH7_REG_OPMENU))
+				return 1;
+			if (rmmio_vall(ich_spibar + ICH7_REG_OPMENU + 4))
+				return 1;
 		}
 		mmio_writew(preop, ich_spibar + ICH7_REG_PREOP);
 		mmio_writew(optype, ich_spibar + ICH7_REG_OPTYPE);
@@ -560,8 +562,10 @@  static int program_opcodes(OPCODES *op, int enable_undo)
 				return 1;
 			if (rmmio_valw(ich_spibar + ICH9_REG_OPTYPE))
 				return 1;
-			rmmio_vall(ich_spibar + ICH9_REG_OPMENU);
-			rmmio_vall(ich_spibar + ICH9_REG_OPMENU + 4);
+			if (rmmio_vall(ich_spibar + ICH9_REG_OPMENU))
+				return 1;
+			if (rmmio_vall(ich_spibar + ICH9_REG_OPMENU + 4))
+				return 1;
 		}
 		mmio_writew(preop, ich_spibar + ICH9_REG_PREOP);
 		mmio_writew(optype, ich_spibar + ICH9_REG_OPTYPE);
diff --git a/programmer.h b/programmer.h
index 0f3c310..df40eb9 100644
--- a/programmer.h
+++ b/programmer.h
@@ -358,7 +358,7 @@  int rmmio_le_writel(uint32_t val, void *addr);
 #define pci_rmmio_writel rmmio_le_writel
 int rmmio_valb(void *addr);
 int rmmio_valw(void *addr);
-void rmmio_vall(void *addr);
+int rmmio_vall(void *addr);
 
 /* dummyflasher.c */
 #if CONFIG_DUMMY == 1