From 7d0fb1f7ef336ebf8fbc5a6d9868f246005fcdf1 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 2 Dec 2008 04:54:31 +0000 Subject: [PATCH] Don't call destroy_dev on the alias. This fixes half a dozen PRs I think. --- sys/dev/cardbus/cardbus_device.c | 10 ++++------ sys/dev/cardbus/cardbusvar.h | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/sys/dev/cardbus/cardbus_device.c b/sys/dev/cardbus/cardbus_device.c index b930444dd506..50e2e98c258d 100644 --- a/sys/dev/cardbus/cardbus_device.c +++ b/sys/dev/cardbus/cardbus_device.c @@ -112,15 +112,15 @@ cardbus_device_create(struct cardbus_softc *sc, struct cardbus_devinfo *devi, device_t parent, device_t child) { uint32_t minor; + int unit; cardbus_device_buffer_cis(parent, child, &devi->sc_cis); minor = (device_get_unit(sc->sc_dev) << 8) + devi->pci.cfg.func; + unit = device_get_unit(sc->sc_dev); devi->sc_cisdev = make_dev(&cardbus_cdevsw, minor, 0, 0, 0666, - "cardbus%d.%d.cis", device_get_unit(sc->sc_dev), - devi->pci.cfg.func); + "cardbus%d.%d.cis", unit, devi->pci.cfg.func); if (devi->pci.cfg.func == 0) - devi->sc_cisdev_compat = make_dev_alias(devi->sc_cisdev, - "cardbus%d.cis", device_get_unit(sc->sc_dev)); + make_dev_alias(devi->sc_cisdev, "cardbus%d.cis", unit); devi->sc_cisdev->si_drv1 = devi; return (0); } @@ -130,8 +130,6 @@ cardbus_device_destroy(struct cardbus_devinfo *devi) { if (devi->sc_cisdev) destroy_dev(devi->sc_cisdev); - if (devi->sc_cisdev_compat) - destroy_dev(devi->sc_cisdev_compat); return (0); } diff --git a/sys/dev/cardbus/cardbusvar.h b/sys/dev/cardbus/cardbusvar.h index 941cc0a61b38..6264f6945af9 100644 --- a/sys/dev/cardbus/cardbusvar.h +++ b/sys/dev/cardbus/cardbusvar.h @@ -60,7 +60,6 @@ struct cardbus_devinfo } funce; uint32_t fepresent; /* bit mask of funce values present */ struct cdev *sc_cisdev; - struct cdev *sc_cisdev_compat; struct cis_buffer sc_cis; };