Commit 4942e00e authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Felipe Balbi

usb: isp1760: Pass resource pointer to isp1760_register

The function takes quite a few arguments, passing the resource pointer
instead of the start address and length simplifies it a bit.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d69292a8
...@@ -2211,9 +2211,8 @@ void isp1760_deinit_kmem_cache(void) ...@@ -2211,9 +2211,8 @@ void isp1760_deinit_kmem_cache(void)
kmem_cache_destroy(urb_listitem_cachep); kmem_cache_destroy(urb_listitem_cachep);
} }
int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq, int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
unsigned long irqflags, struct device *dev, struct device *dev, unsigned int devflags)
unsigned int devflags)
{ {
struct usb_hcd *hcd; struct usb_hcd *hcd;
struct isp1760_hcd *priv; struct isp1760_hcd *priv;
...@@ -2239,15 +2238,15 @@ int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq, ...@@ -2239,15 +2238,15 @@ int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq,
} }
init_memory(priv); init_memory(priv);
hcd->regs = ioremap(res_start, res_len); hcd->regs = ioremap(mem->start, resource_size(mem));
if (!hcd->regs) { if (!hcd->regs) {
ret = -EIO; ret = -EIO;
goto err_put; goto err_put;
} }
hcd->irq = irq; hcd->irq = irq;
hcd->rsrc_start = res_start; hcd->rsrc_start = mem->start;
hcd->rsrc_len = res_len; hcd->rsrc_len = resource_size(mem);
ret = usb_add_hcd(hcd, irq, irqflags); ret = usb_add_hcd(hcd, irq, irqflags);
if (ret) if (ret)
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
#define _ISP1760_HCD_H_ #define _ISP1760_HCD_H_
/* exports for if */ /* exports for if */
int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq, int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
unsigned long irqflags, struct device *dev, struct device *dev, unsigned int devflags);
unsigned int devflags);
void isp1760_unregister(struct device *dev); void isp1760_unregister(struct device *dev);
int isp1760_init_kmem_once(void); int isp1760_init_kmem_once(void);
......
...@@ -133,8 +133,8 @@ static int isp1761_pci_probe(struct pci_dev *dev, ...@@ -133,8 +133,8 @@ static int isp1761_pci_probe(struct pci_dev *dev,
writel(reg_data, iobase + PLX_INT_CSR_REG); writel(reg_data, iobase + PLX_INT_CSR_REG);
dev->dev.dma_mask = NULL; dev->dev.dma_mask = NULL;
ret_status = isp1760_register(pci_mem_phy0, memlength, dev->irq, ret_status = isp1760_register(&dev->resource[3], dev->irq, IRQF_SHARED,
IRQF_SHARED, &dev->dev, devflags); &dev->dev, devflags);
if (ret_status < 0) if (ret_status < 0)
goto cleanup3; goto cleanup3;
...@@ -257,8 +257,8 @@ static int isp1760_plat_probe(struct platform_device *pdev) ...@@ -257,8 +257,8 @@ static int isp1760_plat_probe(struct platform_device *pdev)
devflags |= ISP1760_FLAG_DREQ_POL_HIGH; devflags |= ISP1760_FLAG_DREQ_POL_HIGH;
} }
ret = isp1760_register(mem_res->start, mem_size, irq_res->start, ret = isp1760_register(mem_res, irq_res->start, irqflags, &pdev->dev,
irqflags, &pdev->dev, devflags); devflags);
if (ret < 0) if (ret < 0)
goto cleanup; goto cleanup;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment