From: Oussama Ghorbel Date: Tue, 4 Nov 2014 06:17:06 +0000 (+0530) Subject: phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly X-Git-Tag: v3.17.3~117 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=841c21075428691556265681b25f8ed6618be0b9;p=thirdparty%2Fkernel%2Fstable.git phy: omap-usb2: Enable runtime PM of omap-usb2 phy properly commit f20531a9aae0c7378d9fa75b4b5d99b7eecab066 upstream. The USB OTG port does not work since v3.16 on omap platform. This is a regression introduced by the commit eb82a3d846fa (phy: omap-usb2: Balance pm_runtime_enable() on probe failure and remove). This because the call to pm_runtime_enable() function is moved after the call to devm_phy_create() function, which has side effect since later in the subsequent calls of devm_phy_create() there is a check with pm_runtime_enabled() to configure few things. Fixes: eb82a3d846fa Signed-off-by: Oussama Ghorbel Tested-by: Rabin Vincent Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 93d78359246c8..acc13f8179c31 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c @@ -262,14 +262,16 @@ static int omap_usb2_probe(struct platform_device *pdev) otg->phy = &phy->phy; platform_set_drvdata(pdev, phy); + pm_runtime_enable(phy->dev); generic_phy = devm_phy_create(phy->dev, NULL, &ops, NULL); - if (IS_ERR(generic_phy)) + if (IS_ERR(generic_phy)) { + pm_runtime_disable(phy->dev); return PTR_ERR(generic_phy); + } phy_set_drvdata(generic_phy, phy); - pm_runtime_enable(phy->dev); phy_provider = devm_of_phy_provider_register(phy->dev, of_phy_simple_xlate); if (IS_ERR(phy_provider)) {