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: 144731 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5306715ljj; Tue, 21 Aug 2018 06:56:08 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxlXfVS1xQfdYuQR2aYnNm4TBO8fbeYYVeEKrnhHtSYJ+V0Bc9Y4tm3QLB8/5V9//9Gtku3 X-Received: by 2002:a63:334f:: with SMTP id z76-v6mr6496003pgz.104.1534859768322; Tue, 21 Aug 2018 06:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534859768; cv=none; d=google.com; s=arc-20160816; b=wAu8WGuFP4wgxJU/YT4glNsMk/bu3uGwPe85rv8VhW1bDfXB0fD8M9yMimd24LrLIT ar3qQK96ZGQrTMZ+Ki0dmm2S8DDs8VYiLUC8TISmfHtRCdlcuPEyKNlqhJkjzeuF1PoT wdgWGJy6PLRmiwG+4gvI8eMR4S57dqxwELmMRe7FrUZCIvI/T2llfByg74ENZURcriqA dcy/JeOC3XPCH5RpIuuTKRGx+7QjNAjwJlVPtn/77jlsvrDmF+hX38flOdHvQRIW+TLJ YftOQ99Ai7PUPcaogsDKtGEAU7/3HAy/yj9qo8B+ZcGXu6tPdih2TZUxUt7uV/6Y2XmB j8mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Rud9e58rlzxkEYqPSUxDiFrZuB739LO+zK7RVW9bYas=; b=wrsv0/wZrviX9CcTDfF6cwcXLpkKLBFQUXC50IGhvesoREucStn03Ffb0Gp5VRnSXl 9Oe93JCthSaaoIATYUUMncOGYwzTGYdzwddMfBbcnPV+6q01TiJnm1wIcV//0NZI8wgo UFNmLJ9kxyAZwmGWQ9AvfIQpKZlsevNL01dcUqRLX09RriltpiPcuImcAM804bZcsMym dk5BIim2H2enymPFr0TL77t9CAJZgURLbakfUzgYr/UbRf+TShaoJlp1pA0MsQbx9wi9 Je9hCb5UbrqDb+FgAR6/kU2LOkjF+Hw92bQRUMDosaHhhSq5KKn0zbYvPPktFEkn6YzF lA9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iYx2VMAA; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25-v6si7569484pgm.58.2018.08.21.06.56.08; Tue, 21 Aug 2018 06:56:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iYx2VMAA; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727372AbeHURQW (ORCPT + 13 others); Tue, 21 Aug 2018 13:16:22 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54907 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727322AbeHURQV (ORCPT ); Tue, 21 Aug 2018 13:16:21 -0400 Received: by mail-wm0-f66.google.com with SMTP id c14-v6so3023257wmb.4 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=p7TKoLAMQ6jwOoaTo3hi+HZywhnkCL/p7pWTmySsYBwOGFNBGP6YrEGD6a6JoTo6An 3ZTmHLWSem2MOel59vrsSzofIjwdN+At1ka/TH/SkgOi9L3ANB4hE+kIDTunMRx34Puw 9cplxOk5u4y2vHWdp2pA7p4F7duwTHPwuF8IiGo5AgW2c2Kd2yAKt4Ut6IBLfu9rOu/X xOk3HduxHppsLITOEg5qBQfJGi8In2nRHJgu0WvLspqm+O/6laBButM3vYcoUMJxbVXb z7PswtrEJx/+UvyRCS0IdHUZlghrxYCoXj+ByRbIErjPabtZQ7LZBzXRBRsVcLW9J/fX I4LA== X-Gm-Message-State: APzg51B/L2mmhgdLt8J2cmxn/9nHzFyDsja8KDKh+s4Z1mj8IFkBHDmd 0jhclGTSId+TinCiI5n1hrgMKg== 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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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(+) -- 2.7.4 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);