Skip to contentSkip to conversation

platform: goldfish: pipe: switch to platform_get_irq

PATCH New Yangtao Li 1 participant 1 message Dec 29, 2019

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 platform: goldfish: pipe: switch to platform_get_irq

platform_get_resource(pdev, IORESOURCE_IRQ) is not recommended for requesting IRQ's resources, as they can be not ready yet. Using platform_get_irq() instead is preferred for getting IRQ even if it was not retrieved earlier.

---
 drivers/platform/goldfish/goldfish_pipe.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/platform/goldfish/goldfish_pipe.c +3 -5
index cef0133aa47a..a1ebaec6eea9 100644
@@ -913,11 +913,9 @@ static int goldfish_pipe_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	r = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-	if (!r)
-		return -EINVAL;
-
-	dev->irq = r->start;
+	dev->irq = platform_get_irq(pdev, 0);
+	if (dev->irq < 0)
+		return dev->irq;
 
 	/*
 	 * Exchange the versions with the host device
Signature · 1 line
2.17.1