From a5053e5684c3643b6d8cab6a085b93abdb2ac8f4 Mon Sep 17 00:00:00 2001 From: ps Date: Sun, 18 Apr 2004 02:39:01 +0000 Subject: move the cleanup of the control device into ciss_free and add some ifdefs for the diffrent kthread_create API between -current and -stable --- sys/dev/ciss/ciss.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sys/dev/ciss') diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index f060da7..7e581bc 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -458,8 +458,6 @@ ciss_detach(device_t dev) /* flush adapter cache */ ciss_flush_adapter(sc); - destroy_dev(sc->ciss_dev_t); - /* release all resources */ ciss_free(sc); @@ -1503,6 +1501,10 @@ ciss_free(struct ciss_softc *sc) ciss_kill_notify_thread(sc); + /* remove the control device */ + if (sc->ciss_dev_t != NULL) + destroy_dev(sc->ciss_dev_t); + /* free the controller data */ if (sc->ciss_id != NULL) free(sc->ciss_id, CISS_MALLOC_CLASS); @@ -3412,9 +3414,15 @@ static void ciss_spawn_notify_thread(struct ciss_softc *sc) { +#if __FreeBSD_version > 500005 if (kthread_create((void(*)(void *))ciss_notify_thread, sc, &sc->ciss_notify_thread, 0, 0, "ciss_notify%d", device_get_unit(sc->ciss_dev))) +#else + if (kthread_create((void(*)(void *))ciss_notify_thread, sc, + &sc->ciss_notify_thread, "ciss_notify%d", + device_get_unit(sc->ciss_dev))) +#endif panic("Could not create notify thread\n"); } -- cgit v1.1