[2282] 2009-06-09 Oliver Henshaw <[email protected]>

Vladimir Serbinenko <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2282
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2282
Author:   phcoder
Date:     2009-06-08 23:56:06 +0000 (Mon, 08 Jun 2009)
Log Message:
-----------
2009-06-09  Oliver Henshaw <[email protected]>

        * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after 
	initialising controller.
        * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/bus/usb/ohci.c
    trunk/grub2/bus/usb/uhci.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-06-08 20:51:16 UTC (rev 2281)
+++ trunk/grub2/ChangeLog	2009-06-08 23:56:06 UTC (rev 2282)
@@ -1,3 +1,9 @@
+2009-06-09  Oliver Henshaw <[email protected]>
+
+        * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after 
+	initialising controller.
+        * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise.
+
 2009-06-08  Felix Zielcke  <[email protected]>
 
 	* util/i386/pc/grub-install.in: Add a parameter --disk-module

Modified: trunk/grub2/bus/usb/ohci.c
===================================================================
--- trunk/grub2/bus/usb/ohci.c	2009-06-08 20:51:16 UTC (rev 2281)
+++ trunk/grub2/bus/usb/ohci.c	2009-06-08 23:56:06 UTC (rev 2282)
@@ -152,9 +152,6 @@
   if (! o)
     return 1;
 
-  /* Link in the OHCI.  */
-  o->next = ohci;
-  ohci = o;
   o->iobase = (grub_uint32_t *) base;
 
   /* Reserve memory for the HCCA.  */
@@ -190,6 +187,10 @@
   grub_dprintf ("ohci", "OHCI enable: 0x%02x\n",
 		(grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) >> 6) & 3);
  
+  /* Link to ohci now that initialisation is successful.  */
+  o->next = ohci;
+  ohci = o;
+
   return 0;
 
  fail:

Modified: trunk/grub2/bus/usb/uhci.c
===================================================================
--- trunk/grub2/bus/usb/uhci.c	2009-06-08 20:51:16 UTC (rev 2281)
+++ trunk/grub2/bus/usb/uhci.c	2009-06-08 23:56:06 UTC (rev 2282)
@@ -174,8 +174,6 @@
   if (! u)
     return 1;
 
-  u->next = uhci;
-  uhci = u;
   u->iobase = base & GRUB_UHCI_IOMASK;
   u->framelist = 0;
   u->qh = 0;
@@ -288,6 +286,10 @@
   }
 #endif
 
+  /* Link to uhci now that initialisation is successful.  */
+  u->next = uhci;
+  uhci = u;
+
   return 0;
 
  fail:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.