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.tip...@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

-- 
_______________________________________________
linux-yocto mailing list
linux-yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/linux-yocto

Reply via email to