diff options
Diffstat (limited to 'sys/dev/isa')
-rw-r--r-- | sys/dev/isa/mcd.c | 15 | ||||
-rw-r--r-- | sys/dev/isa/wd.c | 17 |
2 files changed, 18 insertions, 14 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; diff --git a/sys/dev/isa/wd.c b/sys/dev/isa/wd.c index 9eabee7e782..3858438158f 100644 --- a/sys/dev/isa/wd.c +++ b/sys/dev/isa/wd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wd.c,v 1.23 1996/11/29 22:55:08 niklas Exp $ */ +/* $OpenBSD: wd.c,v 1.24 1997/01/04 08:50:24 deraadt Exp $ */ /* $NetBSD: wd.c,v 1.150 1996/05/12 23:54:03 mycroft Exp $ */ /* @@ -92,7 +92,7 @@ struct cfdriver wd_cd = { NULL, "wd", DV_DISK }; -void wdgetdisklabel __P((struct wd_softc *)); +void wdgetdisklabel __P((dev_t, struct wd_softc *)); int wd_get_parms __P((struct wd_softc *)); void wdstrategy __P((struct buf *)); @@ -433,7 +433,7 @@ wdopen(dev, flag, fmt, p) } /* Load the partition info if not already loaded. */ - wdgetdisklabel(wd); + wdgetdisklabel(dev, wd); } } @@ -508,7 +508,8 @@ wdclose(dev, flag, fmt, p) * Fabricate a default disk label, and try to read the correct one. */ void -wdgetdisklabel(wd) +wdgetdisklabel(dev, wd) + dev_t dev; struct wd_softc *wd; { struct disklabel *lp = wd->sc_dk.dk_label; @@ -550,8 +551,8 @@ wdgetdisklabel(wd) if (d_link->sc_state > RECAL) d_link->sc_state = RECAL; - errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART), - wdstrategy, lp, wd->sc_dk.dk_cpulabel); + errstring = readdisklabel(WDLABELDEV(dev), wdstrategy, lp, + wd->sc_dk.dk_cpulabel); if (errstring) { /* * This probably happened because the drive's default @@ -561,8 +562,8 @@ wdgetdisklabel(wd) */ if (d_link->sc_state > GEOMETRY) d_link->sc_state = GEOMETRY; - errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART), - wdstrategy, lp, wd->sc_dk.dk_cpulabel); + errstring = readdisklabel(WDLABELDEV(dev), wdstrategy, lp, + wd->sc_dk.dk_cpulabel); } if (errstring) { printf("%s: %s\n", wd->sc_dev.dv_xname, errstring); |