]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
esd/common/fpga.c: fix 'assignment of read-only location' error
authorWolfgang Denk <wd@denx.de>
Sun, 9 Mar 2008 09:09:53 +0000 (10:09 +0100)
committerWolfgang Denk <wd@denx.de>
Sun, 9 Mar 2008 09:09:53 +0000 (10:09 +0100)
Signed-off-by: Wolfgang Denk <wd@denx.de>
board/esd/common/fpga.c

index aab5509bcbfa8ea998e1601f61258631a97aace5..dc9266256afdcb054be3e19cba593f323f88b2b7 100644 (file)
@@ -96,10 +96,10 @@ static int fpga_boot(const unsigned char *fpgadata, int size)
 {
   int i,index,len;
   int count;
+  unsigned char b;
 #ifdef CFG_FPGA_SPARTAN2
   int j;
 #else
-  unsigned char b;
   int bit;
 #endif
 
@@ -196,9 +196,10 @@ static int fpga_boot(const unsigned char *fpgadata, int size)
    */
   for (i=index; i<size; i++)
     {
+      b = fpgadata[i];
       for (j=0; j<8; j++)
        {
-         if ((fpgadata[i] & 0x80) == 0x80)
+         if ((b & 0x80) == 0x80)
            {
              FPGA_WRITE_1;
            }
@@ -206,7 +207,7 @@ static int fpga_boot(const unsigned char *fpgadata, int size)
            {
              FPGA_WRITE_0;
            }
-         fpgadata[i] <<= 1;
+         b <<= 1;
        }
     }
 #else