/*! * zasevb_modexit() - This is used as module exit, and as cleanup if modinit fails. */ static void zasevb_modexit (void) { struct otg_instance *otg = ocd_instance->otg; //struct pcd_instance *pcd = (struct pcd_instance *)otg->pcd; //struct usbd_bus_instance *bus= pcd->bus; TRACE_MSG0(ZAS, "Modules exit!"); if (otg) otg_exit(otg); mxc_procfs_exit(); /* Disable GPT */ #if defined(CONFIG_OTG_GPTR) mxc_gptcr_mod_exit(); #endif /* defined(CONFIG_OTG_GPTR) */ #if defined(CONFIG_OTG_HRT) mxc_hrt_mod_exit(); #endif /* defined(CONFIG_OTG_GPTR) */ #ifdef OTG_USE_I2C TRACE_MSG0(ZAS, "0. I2C"); i2c_mod_exit(otg); #endif #if !defined(CONFIG_USB_HOST) if (pcd_ops.mod_exit) pcd_ops.mod_exit(otg); REMOVE_pcd_instance = otg_set_pcd_ops(otg, NULL); #else /* !defined(CONFIG_USB_HOST) */ printk(KERN_INFO"%s: PCD DRIVER N/A\n", __FUNCTION__); #endif /* !defined(CONFIG_USB_HOST) */ #if defined(CONFIG_OTG_USB_HOST) || defined(CONFIG_OTG_USB_PERIPHERAL_OR_HOST)|| defined(CONFIG_OTG_DEVICE) if (hcd_ops.mod_exit) hcd_ops.mod_exit(otg); hcd_instance = otg_set_hcd_ops(otg, NULL); //HCD = otg_trace_invalidate_tag(HCD); #else /* defined(CONFIG_OTG_USB_HOST) || defined(CONFIG_OTG_USB_PERIPHERAL_OR_HOST)|| defined(CONFIG_OTG_DEVICE) */ printk(KERN_INFO"%s: HCD DRIVER N/A\n", __FUNCTION__); #endif /* defined(CONFIG_OTG_USB_HOST) || defined(CONFIG_OTG_USB_PERIPHERAL_OR_HOST)|| defined(CONFIG_OTG_DEVICE) */ if (tcd_ops.mod_exit) tcd_ops.mod_exit(otg); printk(KERN_INFO"%s: set_tcd_ops\n", __FUNCTION__); REMOVE_tcd_instance = otg_set_tcd_ops(otg, NULL); //REMOVE_TCD = otg_trace_invalidate_tag(REMOVE_TCD); if (ocd_ops.mod_exit) ocd_ops.mod_exit(otg); ocd_instance = otg_set_ocd_ops(otg, NULL); ZAS = otg_trace_invalidate_tag(ZAS); otg_destroy(otg); }
/* pcd_ocd_modexit - module exit or init failure cleanup * * Specifically for each driver: * * call ops.mod_exit * reset instance address and ops table address in state machine to NULL * invalidate tag */ static void pcd_ocd_modexit (void) { struct otg_instance *otg = ocd_instance->otg; printk(KERN_INFO"%s\n", __FUNCTION__); if (otg) otg_exit(otg); if (pcd_ops.mod_exit) pcd_ops.mod_exit(); pcd_instance = otg_set_pcd_ops(NULL); PCD = otg_trace_invalidate_tag(PCD); if (ocd_ops.mod_exit) ocd_ops.mod_exit(); ocd_instance = otg_set_ocd_ops(NULL); OCD = otg_trace_invalidate_tag(OCD); }