MLK-16285-3 usb: cdns3: core: move INIT_WORK before cdns3_register_extcon
authorPeter Chen <peter.chen@nxp.com>
Fri, 15 Sep 2017 03:13:17 +0000 (11:13 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:36 +0000 (15:38 -0500)
At the extcon notifier, it will queue a work item, so we need to
make sure the work is initialized before it is used.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Acked-by: Li Jun <jun.li@nxp.com>
drivers/usb/cdns3/core.c

index e526018..ddc9fff 100644 (file)
@@ -534,6 +534,7 @@ static int cdns3_probe(struct platform_device *pdev)
        if (ret)
                goto err1;
 
+       INIT_WORK(&cdns->role_switch_wq, cdns3_role_switch);
        ret = cdns3_register_extcon(cdns);
        if (ret)
                goto err2;
@@ -557,7 +558,6 @@ static int cdns3_probe(struct platform_device *pdev)
        if (ret)
                goto err4;
 
-       INIT_WORK(&cdns->role_switch_wq, cdns3_role_switch);
        dev_dbg(dev, "Cadence USB3 core: probe succeed\n");
 
        return 0;