Charger detect and USB state detect workers could be triggered from
USB-HOST and USB cable detect notifiers. Ensure that workers are
initialized before driver register its interest for cable events.
Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
phy = &motg->phy;
phy->dev = &pdev->dev;
+ INIT_WORK(&motg->sm_work, msm_otg_sm_work);
+ INIT_DELAYED_WORK(&motg->chg_work, msm_chg_detect_work);
motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");
if (IS_ERR(motg->clk)) {
writel(0, USB_USBINTR);
writel(0, USB_OTGSC);
- INIT_WORK(&motg->sm_work, msm_otg_sm_work);
- INIT_DELAYED_WORK(&motg->chg_work, msm_chg_detect_work);
ret = devm_request_irq(&pdev->dev, motg->irq, msm_otg_irq, IRQF_SHARED,
"msm_otg", motg);
if (ret) {