static void xhci_ush_pci_remove(struct pci_dev *dev) { struct xhci_hcd *xhci; xhci = hcd_to_xhci(pci_get_drvdata(dev)); if (xhci->shared_hcd) { usb_remove_hcd(xhci->shared_hcd); usb_put_hcd(xhci->shared_hcd); } if (!pci_dev_run_wake(dev)) pm_runtime_get_noresume(&dev->dev); pm_runtime_forbid(&dev->dev); usb_hcd_pci_remove(dev); /* Free the aux irq */ hsic_aux_irq_free(); hsic_wakeup_irq_free(); gpio_free(hsic.aux_gpio); gpio_free(hsic.wakeup_gpio); hsic.hsic_stopped = 1; hsic_enable = 0; kfree(xhci); }
static void xhci_ush_pci_remove(struct pci_dev *dev) { struct xhci_hcd *xhci; xhci = hcd_to_xhci(pci_get_drvdata(dev)); if (xhci->shared_hcd) { usb_remove_hcd(xhci->shared_hcd); usb_put_hcd(xhci->shared_hcd); } if (!pci_dev_run_wake(dev)) pm_runtime_get_noresume(&dev->dev); pm_runtime_forbid(&dev->dev); usb_hcd_pci_remove(dev); /* Free the aux irq */ hsic_aux_irq_free(); hsic_wakeup_irq_free(); gpio_free(hsic.aux_gpio); gpio_free(hsic.wakeup_gpio); hsic.port_disconnect = 1; hsic_enable = 0; wake_lock_destroy(&(hsic.resume_wake_lock)); wake_lock_destroy(&hsic.s3_wake_lock); usb_unregister_notify(&hsic.hsic_pm_nb); unregister_pm_notifier(&hsic.hsic_s3_entry_nb); kfree(xhci); }
static void ehci_hsic_remove(struct pci_dev *pdev) { struct usb_hcd *hcd = pci_get_drvdata(pdev); struct ehci_hcd *ehci = hcd_to_ehci(hcd); if (!hcd) return; hsic.hsic_stopped = 1; hsic_enable = 0; if (pci_dev_run_wake(pdev)) pm_runtime_get_noresume(&pdev->dev); if (!enabling_disabling) { if (!pci_dev_run_wake(pdev)) pm_runtime_get_noresume(&pdev->dev); pm_runtime_forbid(&pdev->dev); } /* Free the aux irq */ hsic_aux_irq_free(); hsic_wakeup_irq_free(); /* Fake an interrupt request in order to give the driver a chance * to test whether the controller hardware has been removed (e.g., * cardbus physical eject). */ local_irq_disable(); usb_hcd_irq(0, hcd); local_irq_enable(); usb_remove_hcd(hcd); #if 0 ehci_hsic_port_power(ehci, 0); #endif /* Set phy low power mode, disable phy clock */ ehci_hsic_phy_power(ehci, 1); if (hcd->driver->flags & HCD_MEMORY) { iounmap(hcd->regs); release_mem_region(hcd->rsrc_start, hcd->rsrc_len); } else { release_region(hcd->rsrc_start, hcd->rsrc_len); } usb_put_hcd(hcd); gpio_free(hsic.aux_gpio); gpio_free(hsic.wakeup_gpio); pci_disable_device(pdev); cancel_delayed_work_sync(&hsic.wakeup_work); destroy_workqueue(hsic.work_queue); wake_lock_destroy(&(hsic.resume_wake_lock)); wake_lock_destroy(&hsic.s3_wake_lock); usb_unregister_notify(&hsic.hsic_pm_nb); unregister_pm_notifier(&hsic.hsic_s3_entry_nb); hsic_debugfs_cleanup(); }