Lines Matching refs:dev
28 __FBSDID("$FreeBSD: releng/11.0/sys/dev/aic/aic_pccard.c 296137 2016-02-27 03:38:01Z jhibbits $");
42 #include <dev/aic/aicvar.h>
43 #include <dev/pccard/pccardvar.h>
72 aic_pccard_alloc_resources(device_t dev)
74 struct aic_pccard_softc *sc = device_get_softc(dev);
80 sc->sc_port = bus_alloc_resource_anywhere(dev, SYS_RES_IOPORT, &rid,
86 sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE);
88 aic_pccard_release_resources(dev);
92 sc->sc_aic.dev = dev;
99 aic_pccard_release_resources(device_t dev)
101 struct aic_pccard_softc *sc = device_get_softc(dev);
104 bus_release_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port);
106 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq);
112 aic_pccard_probe(device_t dev)
116 if ((pp = pccard_product_lookup(dev, aic_pccard_products,
119 device_set_desc(dev, pp->pp_name);
121 device_set_desc(dev,
129 aic_pccard_attach(device_t dev)
131 struct aic_pccard_softc *sc = device_get_softc(dev);
135 if (aic_pccard_alloc_resources(dev))
138 aic_pccard_release_resources(dev);
144 device_printf(dev, "attach failed\n");
145 aic_pccard_release_resources(dev);
149 error = bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_CAM | INTR_ENTROPY |
152 device_printf(dev, "failed to register interrupt handler\n");
153 aic_pccard_release_resources(dev);
160 aic_pccard_detach(device_t dev)
162 struct aic_pccard_softc *sc = device_get_softc(dev);
166 error = bus_teardown_intr(dev, sc->sc_irq, sc->sc_ih);
168 device_printf(dev, "failed to unregister interrupt handler\n");
173 device_printf(dev, "detach failed\n");
177 aic_pccard_release_resources(dev);