Re: [PATCH 08/17] usb: isp1760: Pass resource pointer to isp1760_register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 06, 2014 at 06:54:56PM +0300, Laurent Pinchart wrote:
> 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: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

Reviewed-by: Felipe Balbi <balbi@xxxxxx>

> ---
>  drivers/usb/host/isp1760-hcd.c | 11 +++++------
>  drivers/usb/host/isp1760-hcd.h |  5 ++---
>  drivers/usb/host/isp1760-if.c  | 11 +++++------
>  3 files changed, 12 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c
> index 1574bdd..2c10ad8 100644
> --- a/drivers/usb/host/isp1760-hcd.c
> +++ b/drivers/usb/host/isp1760-hcd.c
> @@ -2216,9 +2216,8 @@ void isp1760_deinit_kmem_cache(void)
>  	kmem_cache_destroy(urb_listitem_cachep);
>  }
>  
> -int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq,
> -		     unsigned long irqflags, int rst_gpio, struct device *dev,
> -		     unsigned int devflags)
> +int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
> +		     int rst_gpio, struct device *dev, unsigned int devflags)
>  {
>  	struct usb_hcd *hcd;
>  	struct isp1760_hcd *priv;
> @@ -2238,15 +2237,15 @@ int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq,
>  	priv->devflags = devflags;
>  	priv->rst_gpio = rst_gpio;
>  	init_memory(priv);
> -	hcd->regs = ioremap(res_start, res_len);
> +	hcd->regs = ioremap(mem->start, resource_size(mem));
>  	if (!hcd->regs) {
>  		ret = -EIO;
>  		goto err_put;
>  	}
>  
>  	hcd->irq = irq;
> -	hcd->rsrc_start = res_start;
> -	hcd->rsrc_len = res_len;
> +	hcd->rsrc_start = mem->start;
> +	hcd->rsrc_len = resource_size(mem);
>  
>  	ret = usb_add_hcd(hcd, irq, irqflags);
>  	if (ret)
> diff --git a/drivers/usb/host/isp1760-hcd.h b/drivers/usb/host/isp1760-hcd.h
> index 4471dab..9c55e93 100644
> --- a/drivers/usb/host/isp1760-hcd.h
> +++ b/drivers/usb/host/isp1760-hcd.h
> @@ -2,9 +2,8 @@
>  #define _ISP1760_HCD_H_
>  
>  /* exports for if */
> -int isp1760_register(phys_addr_t res_start, resource_size_t res_len, int irq,
> -		     unsigned long irqflags, int rst_gpio, struct device *dev,
> -		     unsigned int devflags);
> +int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
> +		     int rst_gpio, struct device *dev, unsigned int devflags);
>  void isp1760_unregister(struct device *dev);
>  
>  int isp1760_init_kmem_once(void);
> diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c
> index 16075fd..891d853 100644
> --- a/drivers/usb/host/isp1760-if.c
> +++ b/drivers/usb/host/isp1760-if.c
> @@ -96,7 +96,7 @@ static int of_isp1760_probe(struct platform_device *dev)
>  		}
>  	}
>  
> -	ret = isp1760_register(memory.start, res_len, virq, IRQF_SHARED,
> +	ret = isp1760_register(&memory, virq, IRQF_SHARED,
>  			       rst_gpio, &dev->dev, devflags);
>  	if (ret < 0)
>  		goto free_gpio;
> @@ -249,9 +249,8 @@ static int isp1761_pci_probe(struct pci_dev *dev,
>  	writel(reg_data, iobase + PLX_INT_CSR_REG);
>  
>  	dev->dev.dma_mask = NULL;
> -	ret_status = isp1760_register(pci_mem_phy0, memlength, dev->irq,
> -				      IRQF_SHARED, -ENOENT, &dev->dev,
> -				      devflags);
> +	ret_status = isp1760_register(&dev->resource[3], dev->irq, IRQF_SHARED,
> +				      -ENOENT, &dev->dev, devflags);
>  	if (ret_status < 0)
>  		goto cleanup3;
>  
> @@ -351,8 +350,8 @@ static int isp1760_plat_probe(struct platform_device *pdev)
>  			devflags |= ISP1760_FLAG_DREQ_POL_HIGH;
>  	}
>  
> -	ret = isp1760_register(mem_res->start, mem_size, irq_res->start,
> -			       irqflags, -ENOENT, &pdev->dev, devflags);
> +	ret = isp1760_register(mem_res, irq_res->start, irqflags, -ENOENT,
> +			       &pdev->dev, devflags);
>  	if (ret < 0) {
>  		pr_warning("isp1760: Failed to register the HCD device\n");
>  		goto cleanup;
> -- 
> 2.0.4
> 

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux