From 2e4847ed73bdf44925947cfde7704b7a80f66dc9 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Thu, 14 Jun 2007 01:10:25 +0000 Subject: [PATCH] xpt_bus_deregister() never returns 0, don't test for it. Assert that the sim is attached if a backend sim function is called, because cam_sim_free() now replaces the functions when the sim is detached. --- sys/dev/usbmisc/umass/umass.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/dev/usbmisc/umass/umass.c b/sys/dev/usbmisc/umass/umass.c index d0e1c8c12d..65deecfd9c 100644 --- a/sys/dev/usbmisc/umass/umass.c +++ b/sys/dev/usbmisc/umass/umass.c @@ -26,7 +26,7 @@ * * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ * $FreeBSD: src/sys/dev/usb/umass.c,v 1.96 2003/12/19 12:19:11 sanpei Exp $ - * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.21 2007/06/13 20:45:24 dillon Exp $ + * $DragonFly: src/sys/dev/usbmisc/umass/umass.c,v 1.22 2007/06/14 01:10:25 dillon Exp $ */ /* @@ -2249,10 +2249,8 @@ umass_cam_detach_sim(struct umass_softc *sc) { callout_stop(&sc->rescan_timeout); if (sc->umass_sim) { - if (xpt_bus_deregister(cam_sim_path(sc->umass_sim))) - cam_sim_free(sc->umass_sim); - else - return(EBUSY); + xpt_bus_deregister(cam_sim_path(sc->umass_sim)); + cam_sim_free(sc->umass_sim); sc->umass_sim = NULL; } @@ -2560,11 +2558,7 @@ umass_cam_poll(struct cam_sim *sim) { struct umass_softc *sc = (struct umass_softc *) sim->softc; - if (sc->umass_sim == NULL) { - kprintf("%s: cam poll after detach!\n", - USBDEVNAME(sc->sc_dev)); - return; - } + KKASSERT(sc != NULL); DPRINTF(UDMASS_SCSI, ("%s: CAM poll\n", USBDEVNAME(sc->sc_dev))); -- 2.11.4.GIT