From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Loic Poulain <loic.poulain@linaro.org>
Cc: Peter.Chen@nxp.com, linux-usb@vger.kernel.org,
linux-arm-msm@vger.kernel.org, david.brown@linaro.org,
robh+dt@kernel.org, andy.gross@linaro.org
Subject: [5/6] phy: qcom-usb-hs: Fix unbalanced notifier registration
Date: Thu, 23 Aug 2018 10:27:17 -0700 [thread overview]
Message-ID: <20180823172717.GG3048@tuxbook-pro> (raw)
On Tue 21 Aug 06:55 PDT 2018, Loic Poulain wrote:
> 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 <loic.poulain@linaro.org>
> ---
> 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);
As I presume the power_on should always be matched with a power_off I
wonder if it really is appropriate to use the devres version of this
API.
Should we drop the devm_ from registration in power_on as well?
> + }
> +
> regulator_disable(uphy->v3p3);
> regulator_disable(uphy->v1p8);
> clk_disable_unprepare(uphy->sleep_clk);
Regards,
Bjorn
next reply other threads:[~2018-08-23 17:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-23 17:27 Bjorn Andersson [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-08-24 9:17 [5/6] phy: qcom-usb-hs: Fix unbalanced notifier registration Loic Poulain
2018-08-21 13:55 Loic Poulain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180823172717.GG3048@tuxbook-pro \
--to=bjorn.andersson@linaro.org \
--cc=Peter.Chen@nxp.com \
--cc=andy.gross@linaro.org \
--cc=david.brown@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox