mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pengpeng Hou <hppiscas@163.com>
To: Thierry Reding <thierry.reding@kernel.org>
Cc: "Pengpeng Hou" <hppiscas@163.com>,
	"Uwe Kleine-König" <ukleinek@kernel.org>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Philipp Zabel" <p.zabel@pengutronix.de>,
	linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2] pwm: tegra: check reset deassertion status
Date: Wed, 14 Oct 2026 11:20:27 +0800	[thread overview]
Message-ID: <20261014032027.9508-1-hppiscas@163.com> (raw)

Check reset_control_deassert() before registering the PWM chip and
use the existing runtime-PM cleanup path if it reports an error.

This is an API-consistency change, not a claim of an observed failure on
supported Tegra systems. Keep the existing reset assertion before PM
teardown in remove and the pwmchip_add() failure path.

The issue was found by our static-analysis tool and manually reviewed.

Acked-by: Thierry Reding <treding@nvidia.com>
Assisted-by: gpt 5
Signed-off-by: Pengpeng Hou <hppiscas@163.com>
---
Changes since v1:
- drop Fixes and stable-backport implications, as Thierry requested
- retain the small status check and Thierry's Acked-by
- keep explicit reset ownership: moving assert to devres would put it
  after the driver's PM teardown, rather than preserve the existing order

Previous version:
https://lore.kernel.org/all/20260830125843.99132-1-pengpeng@iscas.ac.cn/

 drivers/pwm/pwm-tegra.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 5cdbe120ba2d8dafd81ea5520f1a637827d8eecf..d9fa16a7b31f43bd9d75474f851899956159d836 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -379,7 +379,9 @@ static int tegra_pwm_probe(struct platform_device *pdev)
 		goto put_pm;
 	}
 
-	reset_control_deassert(pc->rst);
+	ret = reset_control_deassert(pc->rst);
+	if (ret)
+		goto put_pm;
 
 	chip->ops = &tegra_pwm_ops;
 

base-commit: 4056b3c9d3c92ea45955641dbafeb9b960e146ef


                 reply	other threads:[~2026-10-14  3:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261014032027.9508-1-hppiscas@163.com \
    --to=hppiscas@163.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=thierry.reding@kernel.org \
    --cc=ukleinek@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

all inboxes | Powered by JetHome®