diff mbox series

usb: ohci-spear: Remove direct access to platform_device resource list

Message ID 20211215225509.1995417-1-robh@kernel.org
State New
Headers show
Series usb: ohci-spear: Remove direct access to platform_device resource list | expand

Commit Message

Rob Herring Dec. 15, 2021, 10:55 p.m. UTC
The memory resource is already retrieved with platform_get_resource(), so
let's use it instead of assuming it is the first resource in the array.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/usb/host/ohci-spear.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alan Stern Dec. 16, 2021, 4:10 p.m. UTC | #1
On Wed, Dec 15, 2021 at 04:55:09PM -0600, Rob Herring wrote:
> The memory resource is already retrieved with platform_get_resource(), so
> let's use it instead of assuming it is the first resource in the array.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/host/ohci-spear.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
> index b4cd9e6c72fd..9b81f420656d 100644
> --- a/drivers/usb/host/ohci-spear.c
> +++ b/drivers/usb/host/ohci-spear.c
> @@ -76,7 +76,7 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
>  		goto err_put_hcd;
>  	}
>  
> -	hcd->rsrc_start = pdev->resource[0].start;
> +	hcd->rsrc_start = res->start;
>  	hcd->rsrc_len = resource_size(res);
>  
>  	sohci_p = to_spear_ohci(hcd);
> -- 
> 2.32.0
>
diff mbox series

Patch

diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c
index b4cd9e6c72fd..9b81f420656d 100644
--- a/drivers/usb/host/ohci-spear.c
+++ b/drivers/usb/host/ohci-spear.c
@@ -76,7 +76,7 @@  static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
 		goto err_put_hcd;
 	}
 
-	hcd->rsrc_start = pdev->resource[0].start;
+	hcd->rsrc_start = res->start;
 	hcd->rsrc_len = resource_size(res);
 
 	sohci_p = to_spear_ohci(hcd);