summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2006-08-27 04:31:55 +0000
committerchristos <christos@NetBSD.org>2006-08-27 04:31:55 +0000
commitbcecf5d797f11be4740b8a05026ea3c9b60c0f0d (patch)
tree330d31dc2f5beef7fca56e20dd85800afa17134c /sys
parentfddb23d3e2e0b85aad1570c7cd1ce3b28383a3fe (diff)
Fix previous thinko.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/x86/x86/x86_autoconf.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/arch/x86/x86/x86_autoconf.c b/sys/arch/x86/x86/x86_autoconf.c
index f3fda69da42..81a870d3ee0 100644
--- a/sys/arch/x86/x86/x86_autoconf.c
+++ b/sys/arch/x86/x86/x86_autoconf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_autoconf.c,v 1.21 2006/08/27 04:16:33 christos Exp $ */
+/* $NetBSD: x86_autoconf.c,v 1.22 2006/08/27 04:31:55 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -68,9 +68,10 @@ int x86_ndisks;
static struct vnode *
opendisk(struct device *dv)
{
- int bmajor;
+ int bmajor, bminor;
struct vnode *tmpvn;
- int error, raw_part;
+ int error;
+ dev_t dev;
/*
* Lookup major number for disk block device.
@@ -79,12 +80,14 @@ opendisk(struct device *dv)
if (bmajor == -1)
return NULL;
+ bminor = minor(device_unit(dv));
/*
* Fake a temporary vnode for the disk, open it, and read
* and hash the sectors.
*/
- raw_part = device_is_a(dv, "dk") ? 0 : RAW_PART;
- if (bdevvp(MAKEDISKDEV(bmajor, device_unit(dv), raw_part), &tmpvn))
+ dev = device_is_a(dv, "dk") ? makedev(bmajor, bminor) :
+ MAKEDISKDEV(bmajor, bminor, RAW_PART);
+ if (bdevvp(dev, &tmpvn))
panic("%s: can't alloc vnode for %s", __func__, dv->dv_xname);
error = VOP_OPEN(tmpvn, FREAD, NOCRED, 0);
if (error) {