]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-02-13 Vladimir Serbinenko <phcoder@gmail.com>
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 13 Feb 2010 15:44:34 +0000 (16:44 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 13 Feb 2010 15:44:34 +0000 (16:44 +0100)
* disk/ieee1275/ofdisk.c (grub_ofdisk_open): Check device type before
opening and not after.

ChangeLog
disk/ieee1275/ofdisk.c

index ff5621a56ff19a4611bbefe92f0f285df2798193..eb937f97e35cfda675b3b78963b96620bb8b6c16 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-13  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Check device type before
+       opening and not after.
+
 2010-02-13  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Macroify
index 05c0dd04db96dbcb4a020bf6fdde0c603c6038c8..e5a4a67fad2f613d28d894b86677307142b46603 100644 (file)
@@ -172,16 +172,6 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
 
   grub_dprintf ("disk", "Opening `%s'.\n", op->devpath);
 
-  grub_ieee1275_open (op->devpath, &dev_ihandle);
-  if (! dev_ihandle)
-    {
-      grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
-      goto fail;
-    }
-
-  grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath,
-               (void *) (unsigned long) dev_ihandle);
-
   if (grub_ieee1275_finddevice (op->devpath, &dev))
     {
       grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't read device properties");
@@ -201,6 +191,16 @@ grub_ofdisk_open (const char *name, grub_disk_t disk)
       goto fail;
     }
 
+  grub_ieee1275_open (op->devpath, &dev_ihandle);
+  if (! dev_ihandle)
+    {
+      grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
+      goto fail;
+    }
+
+  grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath,
+               (void *) (unsigned long) dev_ihandle);
+
   /* XXX: There is no property to read the number of blocks.  There
      should be a property `#blocks', but it is not there.  Perhaps it
      is possible to use seek for this.  */