All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Li <wangli74@huawei.com>
To: <yoshihiro.shimoda.uh@renesas.com>, <kishon@ti.com>,
	<vkoul@kernel.org>, <biju.das@bp.renesas.com>
Cc: <linux-renesas-soc@vger.kernel.org>, <wangli74@huawei.com>
Subject: [PATCH] phy: renesas: rcar-gen3-usb2: disable pm_runtime in case of failure
Date: Wed, 25 Nov 2020 10:31:47 +0800	[thread overview]
Message-ID: <20201125023147.2819115-1-wangli74@huawei.com> (raw)

pm_runtime_enable will increase power disable depth. Thus a pairing
decrement is needed on the error handling path to keep it balanced.

Fixes: 5d8042e95fd4 ("phy: rcar-gen3-usb2: Add support for r8a77470")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Li <wangli74@huawei.com>
---
 drivers/phy/renesas/phy-rcar-gen3-usb2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/renesas/phy-rcar-gen3-usb2.c b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
index e34e4475027c..2cb949f931b6 100644
--- a/drivers/phy/renesas/phy-rcar-gen3-usb2.c
+++ b/drivers/phy/renesas/phy-rcar-gen3-usb2.c
@@ -656,8 +656,10 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
 	 */
 	pm_runtime_enable(dev);
 	phy_usb2_ops = of_device_get_match_data(dev);
-	if (!phy_usb2_ops)
-		return -EINVAL;
+	if (!phy_usb2_ops) {
+		ret = -EINVAL;
+		goto error;
+	}
 
 	mutex_init(&channel->lock);
 	for (i = 0; i < NUM_OF_PHYS; i++) {
-- 
2.25.4


             reply	other threads:[~2020-11-25  2:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25  2:31 Wang Li [this message]
2020-11-25  8:16 ` [PATCH] phy: renesas: rcar-gen3-usb2: disable pm_runtime in case of failure Sergei Shtylyov

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=20201125023147.2819115-1-wangli74@huawei.com \
    --to=wangli74@huawei.com \
    --cc=biju.das@bp.renesas.com \
    --cc=kishon@ti.com \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=vkoul@kernel.org \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.