From patchwork Sat Oct 22 14:33:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 9390761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2676260762 for ; Sat, 22 Oct 2016 14:34:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17ECD28EB1 for ; Sat, 22 Oct 2016 14:34:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C0E128EB3; Sat, 22 Oct 2016 14:34:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE38B28EB1 for ; Sat, 22 Oct 2016 14:34:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxxNl-00050u-Uy; Sat, 22 Oct 2016 14:34:45 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bxxNK-0004sD-P6; Sat, 22 Oct 2016 14:34:19 +0000 Received: by mail-pf0-x243.google.com with SMTP id s8so11487473pfj.2; Sat, 22 Oct 2016 07:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ztNWdvjhQbqMnSIJQUPUdp+dDeQ7SUIV0emQDCwlfpE=; b=0SqYXgrbyShbqDbZZjbSQfEKKGynjTOj9rJKj1W9lAPukH0rA42POBhD0jKdcv3wZl 6PqVk/NuITrBtUzNe7m7NLjWQ5lhDrdvoDGN9V6SHHNP5B1CB2f/3OgLzZ2iQVvPluqj SoaPcYQ5FpE7YZYIUWEFjThfRlGze/E4qFdff3o9oT244WMt3F/4d/7yjYix4dINCnnY Fnbx1ADKCrEy1XRxR/iY8Q95kT0Ih1GKHh1NhzQneg5nmuNNcvouN7dzDwPuxzvVmbup eo09emHbKWRewrMh4tCPbadOLaOVdAvWaRCbhnNv0lZXcFjBcXB0unqcOisy8qpEM2Q6 3WAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ztNWdvjhQbqMnSIJQUPUdp+dDeQ7SUIV0emQDCwlfpE=; b=QKtnUYLKfUbxQNuc5+s8bbS9DxufACDcaUW6+M6h6bwZPUSFO+L/gzfsFTdUSOhg2T w5VnIoy3KeWSlbFStLU7TbSJGWnvCOrWg9CYxmnpOg4MXdiGokGMxrl+dBcupEZZFpr/ YDldWyY9w4OINChcWOP3MJC5o8gWwMeo05qhRsEim1a64FEr3CIwXmtxhSDqhXlf39dV qN2Cti7q4e7mjCCGV35GtJ4k6bSkhpJ2ETU5BBsd+vHHg95w1sJbUVJS3XWXy11uj+0b Pc5hq55zm4L2b4MF13oGbCqEokTDDk4hZo2nEVUKi56e8xzd2ZTl/tuxqkGVELQtd8n/ 5vVA== X-Gm-Message-State: ABUngveh8fHfTqX9rqudN8J6ojd4YUR7O00Lz6HCzcoG3wIdJKVJDC4OW7yPDdERzYORaQ== X-Received: by 10.98.17.196 with SMTP id 65mr11734825pfr.55.1477146837646; Sat, 22 Oct 2016 07:33:57 -0700 (PDT) Received: from localhost.localdomain.localdomain (ec2-52-192-197-227.ap-northeast-1.compute.amazonaws.com. [52.192.197.227]) by smtp.gmail.com with ESMTPSA id e90sm12937626pfd.5.2016.10.22.07.33.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 22 Oct 2016 07:33:57 -0700 (PDT) From: Wei Yongjun To: Kishon Vijay Abraham I , Carlo Caione , Kevin Hilman Subject: [PATCH -next] phy: meson8b-usb2: fix missing clk_disable_unprepare() on error Date: Sat, 22 Oct 2016 14:33:42 +0000 Message-Id: <1477146822-31327-1-git-send-email-weiyj.lk@gmail.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161022_073418_940301_413F3C75 X-CRM114-Status: UNSURE ( 8.33 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Wei Yongjun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix the missing clk_disable_unprepare() before return from phy_meson8b_usb2_power_on() in the error handling case. Signed-off-by: Wei Yongjun --- drivers/phy/phy-meson8b-usb2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/phy/phy-meson8b-usb2.c b/drivers/phy/phy-meson8b-usb2.c index 73bf632..dca3947 100644 --- a/drivers/phy/phy-meson8b-usb2.c +++ b/drivers/phy/phy-meson8b-usb2.c @@ -158,6 +158,7 @@ static int phy_meson8b_usb2_power_on(struct phy *phy) ret = clk_prepare_enable(priv->clk_usb); if (ret) { dev_err(&phy->dev, "Failed to enable USB DDR clock\n"); + clk_disable_unprepare(priv->clk_usb_general); return ret; } @@ -190,6 +191,8 @@ static int phy_meson8b_usb2_power_on(struct phy *phy) if (phy_meson8b_usb2_read(priv, REG_ADP_BC) & REG_ADP_BC_ACA_PIN_FLOAT) { dev_warn(&phy->dev, "USB ID detect failed!\n"); + clk_disable_unprepare(priv->clk_usb); + clk_disable_unprepare(priv->clk_usb_general); return -EINVAL; } }