diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-04 08:50:26 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-01-04 08:50:26 +0000 |
commit | baccd07aab4c2be8288de93d65b05876980f47b9 (patch) | |
tree | 99626972edc13fabc90044bc614afd8a14764e7d /sys/dev/isa/mcd.c | |
parent | e27d09bdbdf823a38f32fd8f43c2ae5adfcc4f1f (diff) |
readdisklabel() with correct dev_t
Diffstat (limited to 'sys/dev/isa/mcd.c')
-rw-r--r-- | sys/dev/isa/mcd.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c index 64ec2eee784..3436a03642e 100644 --- a/sys/dev/isa/mcd.c +++ b/sys/dev/isa/mcd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mcd.c,v 1.18 1996/12/05 13:15:28 deraadt Exp $ */ +/* $OpenBSD: mcd.c,v 1.19 1997/01/04 08:50:25 deraadt Exp $ */ /* $NetBSD: mcd.c,v 1.49 1996/05/12 23:53:11 mycroft Exp $ */ /* @@ -92,6 +92,8 @@ #define MCDUNIT(dev) DISKUNIT(dev) #define MAKEMCDDEV(maj, unit, part) MAKEDISKDEV(maj, unit, part) +#define MCDLABELDEV(dev) (MAKEMCDDEV(major(dev), MCDUNIT(dev), RAW_PART)) + /* toc */ #define MCD_MAXTOCS 104 /* from the Linux driver */ @@ -191,7 +193,7 @@ struct cfdriver mcd_cd = { NULL, "mcd", DV_DISK }; -void mcdgetdisklabel __P((struct mcd_softc *)); +void mcdgetdisklabel __P((dev_t, struct mcd_softc *)); int mcd_get_parms __P((struct mcd_softc *)); void mcdstrategy __P((struct buf *)); void mcdstart __P((struct mcd_softc *)); @@ -341,7 +343,7 @@ mcdopen(dev, flag, fmt, p) goto bad2; /* Fabricate a disk label. */ - mcdgetdisklabel(sc); + mcdgetdisklabel(dev, sc); } } @@ -676,7 +678,8 @@ mcdioctl(dev, cmd, addr, flag, p) * whether the scsi cd driver is linked in. */ void -mcdgetdisklabel(sc) +mcdgetdisklabel(dev, sc) + dev_t dev; struct mcd_softc *sc; { struct disklabel *lp = sc->sc_dk.dk_label; @@ -716,8 +719,8 @@ mcdgetdisklabel(sc) /* * Call the generic disklabel extraction routine */ - errstring = readdisklabel(MAKEMCDDEV(0, sc->sc_dev.dv_unit, RAW_PART), - mcdstrategy, lp, sc->sc_dk.dk_cpulabel); + errstring = readdisklabel(MCDLABELDEV(dev), mcdstrategy, lp, + sc->sc_dk.dk_cpulabel); if (errstring) { printf("%s: %s\n", sc->sc_dev.dv_xname, errstring); return; |