mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
usb: isp1760: Move removal cleanup code to isp1760-hcd.c
The removal cleanup code is duplicated between the different bus glues. Move it to a central location. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
c3cc40ccea
commit
10c73f09dc
3 changed files with 14 additions and 14 deletions
|
@ -2263,6 +2263,16 @@ err_put:
|
||||||
return ERR_PTR(ret);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void isp1760_unregister(struct device *dev)
|
||||||
|
{
|
||||||
|
struct usb_hcd *hcd = dev_get_drvdata(dev);
|
||||||
|
|
||||||
|
usb_remove_hcd(hcd);
|
||||||
|
iounmap(hcd->regs);
|
||||||
|
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
|
||||||
|
usb_put_hcd(hcd);
|
||||||
|
}
|
||||||
|
|
||||||
MODULE_DESCRIPTION("Driver for the ISP1760 USB-controller from NXP");
|
MODULE_DESCRIPTION("Driver for the ISP1760 USB-controller from NXP");
|
||||||
MODULE_AUTHOR("Sebastian Siewior <bigeasy@linuxtronix.de>");
|
MODULE_AUTHOR("Sebastian Siewior <bigeasy@linuxtronix.de>");
|
||||||
MODULE_LICENSE("GPL v2");
|
MODULE_LICENSE("GPL v2");
|
||||||
|
|
|
@ -6,6 +6,8 @@ struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len,
|
||||||
int irq, unsigned long irqflags,
|
int irq, unsigned long irqflags,
|
||||||
struct device *dev, const char *busname,
|
struct device *dev, const char *busname,
|
||||||
unsigned int devflags);
|
unsigned int devflags);
|
||||||
|
void isp1760_unregister(struct device *dev);
|
||||||
|
|
||||||
int init_kmem_once(void);
|
int init_kmem_once(void);
|
||||||
void deinit_kmem_cache(void);
|
void deinit_kmem_cache(void);
|
||||||
|
|
||||||
|
|
|
@ -160,14 +160,7 @@ cleanup1:
|
||||||
|
|
||||||
static void isp1761_pci_remove(struct pci_dev *dev)
|
static void isp1761_pci_remove(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
struct usb_hcd *hcd;
|
isp1760_unregister(&dev->dev);
|
||||||
|
|
||||||
hcd = pci_get_drvdata(dev);
|
|
||||||
|
|
||||||
usb_remove_hcd(hcd);
|
|
||||||
iounmap(hcd->regs);
|
|
||||||
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
|
|
||||||
usb_put_hcd(hcd);
|
|
||||||
|
|
||||||
pci_disable_device(dev);
|
pci_disable_device(dev);
|
||||||
}
|
}
|
||||||
|
@ -291,12 +284,7 @@ cleanup:
|
||||||
|
|
||||||
static int isp1760_plat_remove(struct platform_device *pdev)
|
static int isp1760_plat_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct usb_hcd *hcd = platform_get_drvdata(pdev);
|
isp1760_unregister(&pdev->dev);
|
||||||
|
|
||||||
usb_remove_hcd(hcd);
|
|
||||||
iounmap(hcd->regs);
|
|
||||||
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
|
|
||||||
usb_put_hcd(hcd);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue