Lines Matching defs:nfsmb_sc
216 struct nfsmb_softc *nfsmb_sc = device_get_softc(dev);
219 nfsmb_sc->rid = NF2PCI_SMBASE_1;
221 nfsmb_sc->res = bus_alloc_resource_any(dev, SYS_RES_IOPORT,
222 &nfsmb_sc->rid, RF_ACTIVE);
224 if (nfsmb_sc->res == NULL) {
226 nfsmb_sc->rid = 0x50;
227 nfsmb_sc->res = bus_alloc_resource_any(dev,
228 SYS_RES_IOPORT, &nfsmb_sc->rid, RF_ACTIVE);
229 if (nfsmb_sc->res == NULL) {
235 mtx_init(&nfsmb_sc->lock, device_get_nameunit(dev), "nfsmb", MTX_DEF);
238 nfsmb_sc->smbus = device_add_child(dev, "smbus", -1);
239 if (!nfsmb_sc->smbus) {
244 nfsmb_sc->subdev = NULL;
261 nfsmb_sc->subdev = device_add_child(dev, "nfsmb", -1);
262 if (!nfsmb_sc->subdev) {
300 struct nfsmb_softc *nfsmb_sc = device_get_softc(dev);
302 if (nfsmb_sc->subdev) {
303 device_delete_child(dev, nfsmb_sc->subdev);
304 nfsmb_sc->subdev = NULL;
307 if (nfsmb_sc->smbus) {
308 device_delete_child(dev, nfsmb_sc->smbus);
309 nfsmb_sc->smbus = NULL;
312 mtx_destroy(&nfsmb_sc->lock);
313 if (nfsmb_sc->res) {
314 bus_release_resource(dev, SYS_RES_IOPORT, nfsmb_sc->rid,
315 nfsmb_sc->res);
316 nfsmb_sc->res = NULL;