From patchwork Wed Sep 7 11:07:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12968825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 885ABC6FA8D for ; Wed, 7 Sep 2022 11:08:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RRBcSRdPU2UHNb2aeWptDKdUa8zp73d2XLY5CcSJth4=; b=XuQx4VyF5PgVYn RTMS9KPPfm1xYxt0f8H3IrJV5fl/S03Y3f7njy93UhQGaWtQg87PKDFnqkMEursD9N9OC5yxs+3Cw T//NSlL+Y6tEKL+vkpafHjKK/4vGZlLfp4zd9HMDXETNUdpNqExMv033+zEIgI4YI7bJ8NU0DCFFf nLh3jdikP0/0RnFJoy9qXM9SL4B2QDeU3TUOdOdlNATvUoAu2xsFqr/HIZJenHZMKSWyzeidHwUXv aDXJqrUnN1y3JRo4/VQrqe/EWDAcPM8AnyjKnLYoNOgZpruj7BBJWKjVeF0gTdlQPhHrV/2uGzP5y WbJujG63GbxV7Le7K05A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVsud-005XK4-Ur; Wed, 07 Sep 2022 11:08:07 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVsuM-005X4y-Rp for linux-phy@lists.infradead.org; Wed, 07 Sep 2022 11:07:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B52B86187E; Wed, 7 Sep 2022 11:07:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83AA9C4314B; Wed, 7 Sep 2022 11:07:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662548868; bh=XoIK0EQkKxzC4xdNFK4LPLn7cP1UaBLxqsbTBHanb38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tiHv0Lz3IFcT8fOaUclaFct5n5CWtXtxCOhYPWZCDku3eZtkVhOyICqMasCOSNfsT MSvGexcrDBJmoVaK6odHeZD9A1fMsTMG57i73TkvCJI08lu+sGZL+zPbt3Uk2gDKTN 5bq9KsI3FjOn2IuCf40RH/JSKLDp2GjUE8dc63AuA+dfpZkSpwXfUifnEZRBi7hyl8 XTdIFLNoSBjDj/l0gthVYuiPlsi6IO8vYQNVSpm49/KRs00Y097qzZLQQSOSffGDzZ t3AFXbYDUJ50pf7Ai17wezA+41OpEMW76EMGyh4W6DAQMZFs1OpxWtVMAPREgQRnA4 wInd2/CG4Dx/Q== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oVsuO-0004zC-Rc; Wed, 07 Sep 2022 13:07:52 +0200 From: Johan Hovold To: Vinod Koul Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Kishon Vijay Abraham I , Dmitry Baryshkov , linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 09/16] phy: qcom-qmp-usb: disable runtime PM on unbind Date: Wed, 7 Sep 2022 13:07:21 +0200 Message-Id: <20220907110728.19092-10-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220907110728.19092-1-johan+linaro@kernel.org> References: <20220907110728.19092-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_040751_009870_09E7C0F4 X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Make sure to disable runtime PM also on driver unbind. Fixes: ac0d239936bd ("phy: qcom-qmp: Add support for runtime PM"). Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov --- drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c index fba8e40441cb..b63183aaacb8 100644 --- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c +++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c @@ -2838,7 +2838,9 @@ static int qcom_qmp_phy_usb_probe(struct platform_device *pdev) return -ENOMEM; pm_runtime_set_active(dev); - pm_runtime_enable(dev); + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; /* * Prevent runtime pm from being ON by default. Users can enable * it using power/control in sysfs. @@ -2872,13 +2874,10 @@ static int qcom_qmp_phy_usb_probe(struct platform_device *pdev) phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); if (!IS_ERR(phy_provider)) dev_info(dev, "Registered Qcom-QMP phy\n"); - else - pm_runtime_disable(dev); return PTR_ERR_OR_ZERO(phy_provider); err_node_put: - pm_runtime_disable(dev); of_node_put(child); return ret; }