Skip to contentSkip to conversation

usb: ohci-s3c2410: Use platform_get_irq() to get the interrupt

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

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

PATCH 1/1 usb: ohci-s3c2410: Use platform_get_irq() to get the interrupt

Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers relying on the static IRQ resources is blocking removing the static setup from the DT core code.

---
 drivers/usb/host/ohci-s3c2410.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-s3c2410.c +8 -2
index 1bec9b585e2d..12264c048601 100644
@@ -356,7 +356,7 @@ static int ohci_hcd_s3c2410_probe(struct platform_device *dev)
 {
 	struct usb_hcd *hcd = NULL;
 	struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev);
-	int retval;
+	int retval, irq;
 
 	s3c2410_usb_set_power(info, 1, 1);
 	s3c2410_usb_set_power(info, 2, 1);
@@ -388,9 +388,15 @@ static int ohci_hcd_s3c2410_probe(struct platform_device *dev)
 		goto err_put;
 	}
 
+	irq = platform_get_irq(dev, 0);
+	if (irq < 0) {
+		retval = irq;
+		goto err_put;
+	}
+
 	s3c2410_start_hc(dev, hcd);
 
-	retval = usb_add_hcd(hcd, dev->resource[1].start, 0);
+	retval = usb_add_hcd(hcd, irq, 0);
 	if (retval != 0)
 		goto err_ioremap;
 
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Rob Herring

Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers relying on the static IRQ resources is blocking removing the static setup from the DT core code.

---
 drivers/usb/host/ohci-s3c2410.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Best regards,
Krzysztof

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Rob Herring
Quoted 7 lines · Rob Herring

Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers relying on the static IRQ resources is blocking removing the static setup from the DT core code.

---

Quoted 36 lines
 drivers/usb/host/ohci-s3c2410.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/usb/host/ohci-s3c2410.c +8 -2
index 1bec9b585e2d..12264c048601 100644
@@ -356,7 +356,7 @@ static int ohci_hcd_s3c2410_probe(struct platform_device *dev)
 {
 	struct usb_hcd *hcd = NULL;
 	struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev);
-	int retval;
+	int retval, irq;
 
 	s3c2410_usb_set_power(info, 1, 1);
 	s3c2410_usb_set_power(info, 2, 1);
@@ -388,9 +388,15 @@ static int ohci_hcd_s3c2410_probe(struct platform_device *dev)
 		goto err_put;
 	}
 
+	irq = platform_get_irq(dev, 0);
+	if (irq < 0) {
+		retval = irq;
+		goto err_put;
+	}
+
 	s3c2410_start_hc(dev, hcd);
 
-	retval = usb_add_hcd(hcd, dev->resource[1].start, 0);
+	retval = usb_add_hcd(hcd, irq, 0);
 	if (retval != 0)
 		goto err_ioremap;
 
Signature · 1 line
2.32.0