From patchwork Wed Jul 2 12:03:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 32972 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0521C218C3 for ; Wed, 2 Jul 2014 12:04:44 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id l4sf8249463lbv.2 for ; Wed, 02 Jul 2014 05:04:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=yQjg42vPl9lTgwhTNmQXz5tREi+13+pd1ipVx2ctDos=; b=ehj0Sqg3VE3BKCcTW8PruvK7e/RiMiaUuGKzlMbzMdTiROaOrUVcCENn6HtxXBI1yM +fof0fagSlQFOfnEVLAJypKzcz1Tf8k92OA2qd/cKdQyEHXRorEfDYa2FhY8IN82gEwn Rr42NiS38cnIfEbQ9Y0MQicZn0bEB0NaBjV5If7umoG7cHPu+HzuCr970+M4+ZICUV7W 3v+Bd5+Nca9iI10NqfRtOMLXaUEK87Tc0HgpucOAnd57FenaWiZfa5LvpGhKCNgcx6JI 2E/58WjnwJqV8kz3o56nkO+Q2yYQMkAOeiWMku1XTSJTGta+IcIB4G6bFkvpJgmJw1kT PL+A== X-Gm-Message-State: ALoCoQk/CYB8KST8Xm7fZRd+5Jcyn54Mch5n/eOLtpO4MCbwffaSwTLesqCyfTtPGz5LH4I8JcjD X-Received: by 10.181.13.133 with SMTP id ey5mr430571wid.0.1404302683291; Wed, 02 Jul 2014 05:04:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.1 with SMTP id p1ls16206qga.97.gmail; Wed, 02 Jul 2014 05:04:42 -0700 (PDT) X-Received: by 10.220.53.72 with SMTP id l8mr49564074vcg.16.1404302682784; Wed, 02 Jul 2014 05:04:42 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id pu15si12769231vdb.94.2014.07.02.05.04.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Jul 2014 05:04:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so11259423veb.0 for ; Wed, 02 Jul 2014 05:04:42 -0700 (PDT) X-Received: by 10.58.56.102 with SMTP id z6mr47704218vep.7.1404302682679; Wed, 02 Jul 2014 05:04:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp287915vcb; Wed, 2 Jul 2014 05:04:42 -0700 (PDT) X-Received: by 10.68.136.226 with SMTP id qd2mr70121988pbb.72.1404302681932; Wed, 02 Jul 2014 05:04:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay4si30076842pbc.122.2014.07.02.05.04.41; Wed, 02 Jul 2014 05:04:41 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752883AbaGBMEZ (ORCPT + 27 others); Wed, 2 Jul 2014 08:04:25 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:47287 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524AbaGBMEV (ORCPT ); Wed, 2 Jul 2014 08:04:21 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s62C4KrF031035; Wed, 2 Jul 2014 07:04:20 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s62C4KTj007878; Wed, 2 Jul 2014 07:04:20 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Wed, 2 Jul 2014 07:04:19 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s62C41PK005005; Wed, 2 Jul 2014 07:04:17 -0500 From: Roger Quadros To: , , CC: , , , , , , Roger Quadros Subject: [PATCH 5/6] phy: omap-usb2: Balance pm_runtime_enable() on probe failure Date: Wed, 2 Jul 2014 15:03:57 +0300 Message-ID: <1404302638-3003-6-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1404302638-3003-1-git-send-email-rogerq@ti.com> References: <1404302638-3003-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If probe fails then we need to call pm_runtime_disable() to balance out the previous pm_runtime_enable() call. Else it will cause unbalanced pm_runtime_enable() call in the succeding probe call. This anomaly was observed when the call to devm_phy_create() failed with -EPROBE_DEFER. Signed-off-by: Roger Quadros --- drivers/phy/phy-omap-usb2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index 7007c11..c6f9809 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c @@ -265,15 +265,19 @@ static int omap_usb2_probe(struct platform_device *pdev) pm_runtime_enable(phy->dev); generic_phy = devm_phy_create(phy->dev, &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); phy_provider = devm_of_phy_provider_register(phy->dev, of_phy_simple_xlate); - if (IS_ERR(phy_provider)) + if (IS_ERR(phy_provider)) { + pm_runtime_disable(phy->dev); return PTR_ERR(phy_provider); + } phy->wkupclk = devm_clk_get(phy->dev, "wkupclk"); if (IS_ERR(phy->wkupclk)) {