[OpenBIOS] [commit] r1386 - trunk/openbios-devel/drivers

repository service svn at openbios.org
Thu Feb 25 23:59:54 CET 2016


Author: mcayland
Date: Thu Feb 25 23:59:53 2016
New Revision: 1386
URL: http://tracker.coreboot.org/trac/openbios/changeset/1386

Log:
escc.c: rename offset to index

This better describes the variable since it contains a reference to the
channel rather than an offset.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>

Modified:
   trunk/openbios-devel/drivers/escc.c

Modified: trunk/openbios-devel/drivers/escc.c
==============================================================================
--- trunk/openbios-devel/drivers/escc.c	Sat Feb 20 14:22:24 2016	(r1385)
+++ trunk/openbios-devel/drivers/escc.c	Thu Feb 25 23:59:53 2016	(r1386)
@@ -386,15 +386,15 @@
     phandle_t dnode, aliases;
 
     cell props[10];
-    int offset;
+    int index;
     int legacy;
 
     switch (esnum) {
-    case 2: offset = 1; legacy = 0; break;
-    case 3: offset = 0; legacy = 0; break;
-    case 4: offset = 1; legacy = 1; break;
-    case 5: offset = 0; legacy = 1; break;
-    default: return;
+        case 2: index = 1; legacy = 0; break;
+        case 3: index = 0; legacy = 0; break;
+        case 4: index = 1; legacy = 1; break;
+        case 5: index = 0; legacy = 1; break;
+        default: return;
     }
 
     /* add device */
@@ -425,32 +425,32 @@
     set_property(dnode, "compatible", buf, 9);
 
     if (legacy) {
-        props[0] = IO_ESCC_LEGACY_OFFSET + offset * 0x4;
+        props[0] = IO_ESCC_LEGACY_OFFSET + index * 0x4;
         props[1] = 0x00000001;
-        props[2] = IO_ESCC_LEGACY_OFFSET + offset * 0x4 + 2;
+        props[2] = IO_ESCC_LEGACY_OFFSET + index * 0x4 + 2;
         props[3] = 0x00000001;
-        props[4] = IO_ESCC_LEGACY_OFFSET + offset * 0x4 + 6;
+        props[4] = IO_ESCC_LEGACY_OFFSET + index * 0x4 + 6;
         props[5] = 0x00000001;
         set_property(dnode, "reg", (char *)&props, 6 * sizeof(cell));
     } else {
-        props[0] = IO_ESCC_OFFSET + offset * 0x20;
+        props[0] = IO_ESCC_OFFSET + index * 0x20;
         props[1] = 0x00000020;
         set_property(dnode, "reg", (char *)&props, 2 * sizeof(cell));
     }
 
     if (legacy) {
-        props[0] = addr + IO_ESCC_LEGACY_OFFSET + offset * 0x4;
+        props[0] = addr + IO_ESCC_LEGACY_OFFSET + index * 0x4;
     } else {
-        props[0] = addr + IO_ESCC_OFFSET + offset * 0x20;
+        props[0] = addr + IO_ESCC_OFFSET + index * 0x20;
     }
     OLDWORLD(set_property(dnode, "AAPL,address",
             (char *)&props, 1 * sizeof(cell)));
 
-    props[0] = 0x00000010 - offset;
+    props[0] = 0x00000010 - index;
     OLDWORLD(set_property(dnode, "AAPL,interrupts",
             (char *)&props, 1 * sizeof(cell)));
 
-    props[0] = (0x24) + offset;
+    props[0] = (0x24) + index;
     props[1] = 0;
     props[2] = 0;
     NEWWORLD(set_property(dnode, "interrupts",
@@ -460,11 +460,11 @@
 
     if (legacy) {
         uart_init_line(
-                (unsigned char*)addr + IO_ESCC_LEGACY_OFFSET + offset * 0x4,
+                (unsigned char*)addr + IO_ESCC_LEGACY_OFFSET + index * 0x4,
                 CONFIG_SERIAL_SPEED);
     } else {
         uart_init_line(
-                (unsigned char*)addr + IO_ESCC_OFFSET + offset * 0x20,
+                (unsigned char*)addr + IO_ESCC_OFFSET + index * 0x20,
                 CONFIG_SERIAL_SPEED);
     }
 }



More information about the OpenBIOS mailing list