diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-01-21 00:55:47 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-01-27 09:38:33 -0600 |
commit | f0bdbb0ec6be7465eecbdbea058c027485a0d966 (patch) | |
tree | 05a7c99e0657bc46800c4ec10568b4312149c181 /drivers/usb/host/isp1760-hcd.c | |
parent | 57f068bedca8b92157d09f971f2fb3adb76f8f96 (diff) | |
download | lwn-f0bdbb0ec6be7465eecbdbea058c027485a0d966.tar.gz lwn-f0bdbb0ec6be7465eecbdbea058c027485a0d966.zip |
usb: isp1760: Don't expose hcd to glue code from isp1760_register
The glue code probe functions don't need to access the hcd structure
anymore. Modify isp1760_register to return an integer error code instead
of the hcd pointer.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/host/isp1760-hcd.c')
-rw-r--r-- | drivers/usb/host/isp1760-hcd.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index 19fbd6965630..4d6e50b13d81 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c @@ -60,6 +60,9 @@ struct isp1760_hcd { struct gpio_desc *rst_gpio; }; +typedef void (packet_enqueue)(struct usb_hcd *hcd, struct isp1760_qh *qh, + struct isp1760_qtd *qtd); + static inline struct isp1760_hcd *hcd_to_priv(struct usb_hcd *hcd) { return (struct isp1760_hcd *) (hcd->hcd_priv); @@ -2208,24 +2211,23 @@ void deinit_kmem_cache(void) kmem_cache_destroy(urb_listitem_cachep); } -struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len, - int irq, unsigned long irqflags, - struct device *dev, const char *busname, - unsigned int devflags) +int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq, + unsigned long irqflags, struct device *dev, + const char *busname, unsigned int devflags) { struct usb_hcd *hcd; struct isp1760_hcd *priv; int ret; if (usb_disabled()) - return ERR_PTR(-ENODEV); + return -ENODEV; /* prevent usb-core allocating DMA pages */ dev->dma_mask = NULL; hcd = usb_create_hcd(&isp1760_hc_driver, dev, dev_name(dev)); if (!hcd) - return ERR_PTR(-ENOMEM); + return -ENOMEM; priv = hcd_to_priv(hcd); priv->devflags = devflags; @@ -2254,7 +2256,7 @@ struct usb_hcd *isp1760_register(phys_addr_t res_start, resource_size_t res_len, dev_set_drvdata(dev, hcd); - return hcd; + return 0; err_unmap: iounmap(hcd->regs); @@ -2262,7 +2264,7 @@ err_unmap: err_put: usb_put_hcd(hcd); - return ERR_PTR(ret); + return ret; } void isp1760_unregister(struct device *dev) |