Deleted Added
full compact
80c80
< __FBSDID("$FreeBSD: head/sys/dev/ti/if_ti.c 119288 2003-08-22 07:20:27Z imp $");
---
> __FBSDID("$FreeBSD: head/sys/dev/ti/if_ti.c 120980 2003-10-10 20:35:28Z phk $");
135d134
< #include <sys/vnode.h> /* for vfindev, vgone */
286,299d284
< /* List of Tigon softcs */
< static STAILQ_HEAD(ti_softc_list, ti_softc) ti_sc_list;
<
< static struct ti_softc *
< ti_lookup_softc(int unit)
< {
< struct ti_softc *sc;
< for (sc = STAILQ_FIRST(&ti_sc_list); sc != NULL;
< sc = STAILQ_NEXT(sc, ti_links))
< if (sc->ti_unit == unit)
< return(sc);
< return(NULL);
< }
<
2250,2255d2234
< /*
< * If this is the first card to be initialized, initialize the
< * softc queue.
< */
< if (unit == 0)
< STAILQ_INIT(&ti_sc_list);
2257,2258d2235
< STAILQ_INSERT_TAIL(&ti_sc_list, sc, ti_links);
<
2261a2239
> sc->dev->si_drv1 = sc;
2286,2312d2263
< * Verify that our character special device is not currently
< * open. Also track down any cached vnodes & kill them before
< * the module is unloaded
< */
< static int
< ti_unref_special(device_t dev)
< {
< struct vnode *ti_vn;
< int count;
< struct ti_softc *sc = sc = device_get_softc(dev);
<
< if (!vfinddev(sc->dev, VCHR, &ti_vn)) {
< return 0;
< }
<
< if ((count = vcount(ti_vn))) {
< device_printf(dev, "%d refs to special device, "
< "denying unload\n", count);
< return count;
< }
< /* now we know that there's a vnode in the cache. We hunt it
< down and kill it now, before unloading */
< vgone(ti_vn);
< return(0);
< }
<
< /*
2326,2328d2276
< if (ti_unref_special(dev))
< return EBUSY;
<
2329a2278
> destroy_dev(sc->dev);
3180d3128
< int unit;
3183,3186c3131
< unit = minor(dev) & 0xff;
<
< sc = ti_lookup_softc(unit);
<
---
> sc = dev->si_drv1;
3200d3144
< int unit;
3203,3206c3147
< unit = minor(dev) & 0xff;
<
< sc = ti_lookup_softc(unit);
<
---
> sc = dev->si_drv1;
3223c3164
< int unit, error;
---
> int error;
3226,3229c3167
< unit = minor(dev) & 0xff;
<
< sc = ti_lookup_softc(unit);
<
---
> sc = dev->si_drv1;