+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
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");
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. */