diff options
author | imp <imp@FreeBSD.org> | 2005-09-20 23:48:06 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-09-20 23:48:06 +0000 |
commit | be4ab3ea858b164c1197a6362019218d0856a226 (patch) | |
tree | 87331d5232734d7b8bbc06aeb22a456fe3567f09 /sys/dev | |
parent | eb46ffb0671c2ef8a8807c540cdd252c558dfdeb (diff) | |
download | FreeBSD-src-be4ab3ea858b164c1197a6362019218d0856a226.zip FreeBSD-src-be4ab3ea858b164c1197a6362019218d0856a226.tar.gz |
Use the correct minor number for the pccardX.cis device.
Don't destroy a NULL device.
This should fix the panics on boot people are seeing on systems with
more than one pccard slot.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pccard/pccard_device.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pccard/pccard_device.c b/sys/dev/pccard/pccard_device.c index 0fbbc80..3cee757 100644 --- a/sys/dev/pccard/pccard_device.c +++ b/sys/dev/pccard/pccard_device.c @@ -61,8 +61,11 @@ static struct cdevsw pccard_cdevsw = { int pccard_device_create(struct pccard_softc *sc) { - sc->cisdev = make_dev(&pccard_cdevsw, 0, 0, 0, 0666, "pccard%u.cis", - device_get_unit(sc->dev)); + uint32_t minor; + + minor = device_get_unit(sc->dev) << 16; + sc->cisdev = make_dev(&pccard_cdevsw, minor, 0, 0, 0666, + "pccard%u.cis", device_get_unit(sc->dev)); sc->cisdev->si_drv1 = sc; return (0); } @@ -70,7 +73,8 @@ pccard_device_create(struct pccard_softc *sc) int pccard_device_destroy(struct pccard_softc *sc) { - destroy_dev(sc->cisdev); + if (sc->cisdev) + destroy_dev(sc->cisdev); return (0); } |