Skip to contentSkip to conversation

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

PATCH In review Rob Herring 2 participants 2 messages Dec 15, 2021 – Dec 16, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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.

---
 drivers/usb/host/ohci-spear.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-spear.c +1 -1
index b4cd9e6c72fd..9b81f420656d 100644
@@ -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);
Signature · 1 line
2.32.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Rob Herring

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.

---

Quoted 19 lines
 drivers/usb/host/ohci-spear.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/ohci-spear.c +1 -1
index b4cd9e6c72fd..9b81f420656d 100644
@@ -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);
Signature · 1 line
2.32.0