From patchwork Tue Aug 21 13:55:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10571713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 905B313B6 for ; Tue, 21 Aug 2018 13:56:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82AB92A23C for ; Tue, 21 Aug 2018 13:56:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80D722A399; Tue, 21 Aug 2018 13:56:09 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CB2D2A37E for ; Tue, 21 Aug 2018 13:56:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727383AbeHURQW (ORCPT ); Tue, 21 Aug 2018 13:16:22 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35386 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbeHURQW (ORCPT ); Tue, 21 Aug 2018 13:16:22 -0400 Received: by mail-wm0-f65.google.com with SMTP id o18-v6so2976667wmc.0 for ; Tue, 21 Aug 2018 06:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Rud9e58rlzxkEYqPSUxDiFrZuB739LO+zK7RVW9bYas=; b=iYx2VMAA1elRQI9t9pnjzbTtc4GFaahiAsbVQxlXj4KUGoodjusifp1eO/A6v62Det P4G2/qIyp3HfQvlYTCuBCgzlXoS7Ryy/XkBRda2s1/4+VF0NpEJ9uU1XOaAnIx1oPQaj FLbmIqecPazIeKsUdu1ble9yDNm9iOrzFsZFo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Rud9e58rlzxkEYqPSUxDiFrZuB739LO+zK7RVW9bYas=; b=n7EnXD8Iz8G9YoGdLFBUPWyks5GwK0rayOp248a+pK2d/exIQ+i5l+f4MFV2G2aluh l+n60KYEYuGPPJIAVaEFTvyW2qQbL9JLNwJwKpYggF8dmLULVV4Ky8knPTBfCy8dBcQ5 kJA3Cf7M7oXzhAiMH7UcPTqOmBGnNTunobuqZlLKUQ6eLQgxvJgIJHmVWosU/OAsvzyU iXQmR81KItJqfLS8k6wfUouoRDghm1hbqOXZn4L4k7gk+TeyxEDu5mLfv3W4iQ2wjXoX 0P1j+rHWggO/TNG0/1uijkq4PIFaxLsR88L3GLnEjBG4r9eP39a7UPjTYVnktzh3yJlV 9gTw== X-Gm-Message-State: APzg51A8v2ege8jjzHKivjh6sZEClwuvVc+aZxRIBJ4df1Rp0SN/MzJ5 TmDAOdJ3/L4JTpz2pHVRWrETcw== X-Google-Smtp-Source: ANB0VdYzBDSkPpJkzEydK56A2Ja1BDFz2Es0VgxL8eWLXEYcOtXBdhetnlsPB3UinV9D9mUtWs8WqA== X-Received: by 2002:a1c:1d87:: with SMTP id d129-v6mr1668452wmd.34.1534859765793; Tue, 21 Aug 2018 06:56:05 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-655-1-762-165.w109-220.abo.wanadoo.fr. [109.220.142.165]) by smtp.gmail.com with ESMTPSA id l24-v6sm16728523wrb.65.2018.08.21.06.56.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Aug 2018 06:56:05 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, Loic Poulain Subject: [PATCH 5/6] phy: qcom-usb-hs: Fix unbalanced notifier registration Date: Tue, 21 Aug 2018 15:55:55 +0200 Message-Id: <1534859756-6955-5-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534859756-6955-1-git-send-email-loic.poulain@linaro.org> References: <1534859756-6955-1-git-send-email-loic.poulain@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Phy power on/off cycle can happen several times during device life. We then need to balance the extcon notifier registration accordingly. Fixes: f0b5c2c96370 ("phy: qcom-usb-hs: Replace the extcon API") Signed-off-by: Loic Poulain --- drivers/phy/qualcomm/phy-qcom-usb-hs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/phy/qualcomm/phy-qcom-usb-hs.c b/drivers/phy/qualcomm/phy-qcom-usb-hs.c index 2d0c70b..92e9d94 100644 --- a/drivers/phy/qualcomm/phy-qcom-usb-hs.c +++ b/drivers/phy/qualcomm/phy-qcom-usb-hs.c @@ -181,6 +181,12 @@ static int qcom_usb_hs_phy_power_off(struct phy *phy) { struct qcom_usb_hs_phy *uphy = phy_get_drvdata(phy); + if (uphy->vbus_edev) { + devm_extcon_unregister_notifier(&uphy->ulpi->dev, + uphy->vbus_edev, EXTCON_USB, + &uphy->vbus_notify); + } + regulator_disable(uphy->v3p3); regulator_disable(uphy->v1p8); clk_disable_unprepare(uphy->sleep_clk);