[linux-yocto] [PATCH] Request PMIC threaded interrupt after port registration
Pranav Tipnis
pranav.tipnis at intel.com
Sun Jul 31 12:47:13 PDT 2016
Upstream-Status: Pending
Call devm_request_threaded_interrupt() after all the required structures
are initialized in the probe(). Without this, an incoming interrupt
might invoke threaded interrupt handler before finishing execution
of probe() function.
Signed-off-by: Pranav Tipnis <pranav.tipnis at intel.com>
---
drivers/usb/typec/typec_wcove.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/usb/typec/typec_wcove.c b/drivers/usb/typec/typec_wcove.c
index 5fbeb48..42c5b07 100644
--- a/drivers/usb/typec/typec_wcove.c
+++ b/drivers/usb/typec/typec_wcove.c
@@ -523,17 +523,6 @@ static int wcove_typec_probe(struct platform_device *pdev)
wcove->dev = &pdev->dev;
wcove->regmap = pmic->regmap;
- ret = regmap_irq_get_virq(pmic->irq_chip_data_level2,
- platform_get_irq(pdev, 0));
- if (ret < 0)
- return ret;
-
- ret = devm_request_threaded_irq(&pdev->dev, ret, NULL,
- wcove_typec_irq, IRQF_ONESHOT,
- "wcove_typec", wcove);
- if (ret)
- return ret;
-
wcove->cap.type = TYPEC_PORT_DRP;
wcove->port = typec_register_port(&pdev->dev, &wcove->cap);
if (IS_ERR(wcove->port))
@@ -547,6 +536,17 @@ static int wcove_typec_probe(struct platform_device *pdev)
return -EIO;
}
+ ret = regmap_irq_get_virq(pmic->irq_chip_data_level2,
+ platform_get_irq(pdev, 0));
+ if (ret < 0)
+ return ret;
+
+ ret = devm_request_threaded_irq(&pdev->dev, ret, NULL,
+ wcove_typec_irq, IRQF_ONESHOT,
+ "wcove_typec", wcove);
+ if (ret)
+ return ret;
+
if (!acpi_check_dsm(ACPI_HANDLE(&pdev->dev), uuid.b, 0, 0x1f)) {
dev_err(&pdev->dev, "Missing _DSM functions\n");
return -ENODEV;
--
1.9.1
More information about the linux-yocto
mailing list