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 <[email protected]>
> ---
>  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

Reply via email to