/* * This function will be called when the adapter is removed * from the USB bus. */ static void __devexit disconnect_st5481(struct usb_device *dev, void *arg) { struct st5481_adapter *adapter = arg; DBG(1,""); list_del(&adapter->list); st5481_stop(adapter); st5481_release_b(&adapter->bcs[1]); st5481_release_b(&adapter->bcs[0]); st5481_release_d(adapter); // we would actually better wait for completion of outstanding urbs mdelay(2); st5481_release_usb(adapter); hisax_unregister(&adapter->hisax_d_if); kfree(adapter); }
/* * This function will be called when the adapter is removed * from the USB bus. */ static void disconnect_st5481(struct usb_interface *intf) { struct st5481_adapter *adapter = usb_get_intfdata(intf); DBG(1,""); usb_set_intfdata(intf, NULL); if (!adapter) return; st5481_stop(adapter); st5481_release_b(&adapter->bcs[1]); st5481_release_b(&adapter->bcs[0]); st5481_release_d(adapter); // we would actually better wait for completion of outstanding urbs mdelay(2); st5481_release_usb(adapter); hisax_unregister(&adapter->hisax_d_if); kfree(adapter); }