FreeBSD definitions of (read|write)[bwl] collide with our own

Before we attempt trickery, we can simply rename the accessor functions.

Patch created with the help of Coccinelle.

Corresponding to flashrom svn r420 and coreboot v2 svn r3984.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Idwer Vollering <idwer_v@hotmail.com>
Acked-by: Patrick Georgi <patrick@georgi-clan.de>
diff --git a/sst49lfxxxc.c b/sst49lfxxxc.c
index 397ee61..54897cc 100644
--- a/sst49lfxxxc.c
+++ b/sst49lfxxxc.c
@@ -50,20 +50,20 @@
 	//printf("bios=0x%08lx\n", (unsigned long)bios);
 	for (i = 0; left > 65536; i++, left -= 65536) {
 		//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFC00000 - size + (i * 65536) + 2, *(bios + (i * 65536) + 2) );
-		writeb(bits, bios + (i * 65536) + 2);
+		chip_writeb(bits, bios + (i * 65536) + 2);
 	}
 	address = i * 65536;
 	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
-	writeb(bits, bios + address + 2);
+	chip_writeb(bits, bios + address + 2);
 	address += 32768;
 	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
-	writeb(bits, bios + address + 2);
+	chip_writeb(bits, bios + address + 2);
 	address += 8192;
 	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
-	writeb(bits, bios + address + 2);
+	chip_writeb(bits, bios + address + 2);
 	address += 8192;
 	//printf("lockbits at address=0x%08lx is 0x%01x\n", (unsigned long)0xFFc00000 - size + address + 2, *(bios + address + 2) );
-	writeb(bits, bios + address + 2);
+	chip_writeb(bits, bios + address + 2);
 
 	return 0;
 }
@@ -73,14 +73,14 @@
 {
 	unsigned char status;
 
-	writeb(SECTOR_ERASE, bios);
-	writeb(ERASE, bios + address);
+	chip_writeb(SECTOR_ERASE, bios);
+	chip_writeb(ERASE, bios + address);
 
 	do {
-		status = readb(bios);
+		status = chip_readb(bios);
 		if (status & (STATUS_ESS | STATUS_BPS)) {
 			printf("sector erase FAILED at address=0x%08lx status=0x%01x\n", (unsigned long)bios + address, status);
-			writeb(CLEAR_STATUS, bios);
+			chip_writeb(CLEAR_STATUS, bios);
 			return (-1);
 		}
 	} while (!(status & STATUS_WSMS));
@@ -96,7 +96,7 @@
 	int i;
 	unsigned char status;
 
-	writeb(CLEAR_STATUS, bios);
+	chip_writeb(CLEAR_STATUS, bios);
 	for (i = 0; i < page_size; i++) {
 		/* transfer data from source to destination */
 		if (*src == 0xFF) {
@@ -105,14 +105,14 @@
 			continue;
 		}
 		/*issue AUTO PROGRAM command */
-		writeb(AUTO_PGRM, bios);
-		writeb(*src++, dst++);
+		chip_writeb(AUTO_PGRM, bios);
+		chip_writeb(*src++, dst++);
 
 		do {
-			status = readb(bios);
+			status = chip_readb(bios);
 			if (status & (STATUS_ESS | STATUS_BPS)) {
 				printf("sector write FAILED at address=0x%08lx status=0x%01x\n", (unsigned long)dst, status);
-				writeb(CLEAR_STATUS, bios);
+				chip_writeb(CLEAR_STATUS, bios);
 				return (-1);
 			}
 		} while (!(status & STATUS_WSMS));
@@ -127,13 +127,13 @@
 
 	uint8_t id1, id2;
 
-	writeb(RESET, bios);
+	chip_writeb(RESET, bios);
 
-	writeb(READ_ID, bios);
-	id1 = readb(bios);
-	id2 = readb(bios + 0x01);
+	chip_writeb(READ_ID, bios);
+	id1 = chip_readb(bios);
+	id2 = chip_readb(bios + 0x01);
 
-	writeb(RESET, bios);
+	chip_writeb(RESET, bios);
 
 	printf_debug("%s: id1 0x%02x, id2 0x%02x\n", __FUNCTION__, id1, id2);
 
@@ -157,7 +157,7 @@
 		if (erase_sector_49lfxxxc(bios, i) != 0)
 			return (-1);
 
-	writeb(RESET, bios);
+	chip_writeb(RESET, bios);
 
 	return 0;
 }
@@ -183,7 +183,7 @@
 	}
 	printf("\n");
 
-	writeb(RESET, bios);
+	chip_writeb(RESET, bios);
 
 	return 0;
 }