Linux-Renesas-SoC Archive mirror
 help / color / mirror / Atom feed
From: Prabhakar <prabhakar.csengg@gmail.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Prabhakar <prabhakar.csengg@gmail.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: [PATCH] reset: reset-rzg2l-usbphy-ctrl: Ensure reset line is asserted in error path
Date: Thu, 21 Mar 2024 11:42:01 +0000	[thread overview]
Message-ID: <20240321114201.359381-1-prabhakar.mahadev-lad.rj@bp.renesas.com> (raw)

From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

In the event of failure during devm_reset_controller_register(), ensure
that the reset line is asserted back.

Fixes: bee08559701fb ("reset: renesas: Add RZ/G2L usbphy control driver")
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/reset/reset-rzg2l-usbphy-ctrl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/reset-rzg2l-usbphy-ctrl.c b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
index a8dde4606360..43eb01105596 100644
--- a/drivers/reset/reset-rzg2l-usbphy-ctrl.c
+++ b/drivers/reset/reset-rzg2l-usbphy-ctrl.c
@@ -132,8 +132,10 @@ static int rzg2l_usbphy_ctrl_probe(struct platform_device *pdev)
 	priv->rcdev.dev = dev;
 
 	error = devm_reset_controller_register(dev, &priv->rcdev);
-	if (error)
+	if (error) {
+		reset_control_assert(priv->rstc);
 		return error;
+	}
 
 	spin_lock_init(&priv->lock);
 	dev_set_drvdata(dev, priv);
-- 
2.34.1


             reply	other threads:[~2024-03-21 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 11:42 Prabhakar [this message]
2024-04-17 14:38 ` [PATCH] reset: reset-rzg2l-usbphy-ctrl: Ensure reset line is asserted in error path Geert Uytterhoeven
2024-04-17 20:59   ` Lad, Prabhakar

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=20240321114201.359381-1-prabhakar.mahadev-lad.rj@bp.renesas.com \
    --to=prabhakar.csengg@gmail.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=prabhakar.mahadev-lad.rj@bp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).