Date: Thu, 12 May 2005 10:39:43 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: hselasky@c2i.net Cc: usb@freebsd.org Subject: Re: Panic when removing Airprime PC5220 card (usb hub). Message-ID: <20050512.103943.115908855.imp@bsdimp.com> In-Reply-To: <200505121755.32810.hselasky@c2i.net> References: <20050511.175830.58826830.imp@bsdimp.com> <200505121548.02651.hselasky@c2i.net> <200505121755.32810.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200505121755.32810.hselasky@c2i.net> Hans Petter Selasky <hselasky@c2i.net> writes: : On Thursday 12 May 2005 15:48, Hans Petter Selasky wrote: : > On Thursday 12 May 2005 01:58, M. Warner Losh wrote: : > > In message: <200505120058.51834.hselasky@c2i.net> : > > : > > Hans Petter Selasky <hselasky@c2i.net> writes: : > > : On Wednesday 11 May 2005 22:33, Warner Losh wrote: : : Maybe something like this is better, so that memory doesn't leak. : : usb_disconnect_port(struct usbd_port *up, device_ptr_t parent, : u_int8_t free_subdev) : { : ... : #ifdef __FreeBSD__ : config_detach(dev->subdevs[i], DETACH_FORCE, free_subdev); : #else : config_detach(dev->subdevs[i], DETACH_FORCE); : #endif : ... : } : : #define config_detach(dev, flag, free_subdev) \ : do { \ : free(device_get_ivars(dev), M_USB); \ : if(free_subdev) \ : device_delete_child(device_get_parent(dev), dev); \ : } while (0); Apart from ugly ifdef, that might have some merit. We don't necessarily want to delete devices unless the hardware goes away. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050512.103943.115908855.imp>