linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>
Cc: Jonathan Hunter <jonathanh@nvidia.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-pwm@vger.kernel.org, linux-tegra@vger.kernel.org,
	kernel@pengutronix.de
Subject: [PATCH v1 4/6] pwm: tegra: Assert reset only after the PWM was unregistered
Date: Thu, 17 Jun 2021 11:51:43 +0200	[thread overview]
Message-ID: <20210617095145.163694-5-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210617095145.163694-1-u.kleine-koenig@pengutronix.de>

The driver is supposed to stay functional until pwmchip_remove()
returns. So the reset must be asserted only after that.

pwmchip_remove() always returns 0, so the return code can be ignored
which keeps the tegra_pwm_remove() a bit simpler.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 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 e865743e5989..11a10b575ace 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -301,9 +301,11 @@ static int tegra_pwm_remove(struct platform_device *pdev)
 {
 	struct tegra_pwm_chip *pc = platform_get_drvdata(pdev);
 
+	pwmchip_remove(&pc->chip);
+
 	reset_control_assert(pc->rst);
 
-	return pwmchip_remove(&pc->chip);
+	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
-- 
2.30.2


  parent reply	other threads:[~2021-06-17  9:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  9:51 [PATCH v1 0/6] pwm: tegra: several improvements Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 1/6] pwm: tegra: Drop an if block with an always false condition Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 2/6] pwm: tegra: Don't modify HW state in .remove callback Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 3/6] pwm: tegra: Don't needlessly enable and disable the clock in .remove() Uwe Kleine-König
2021-06-17  9:51 ` Uwe Kleine-König [this message]
2021-06-17  9:51 ` [PATCH v1 5/6] pwm: tegra: Implement .apply callback Uwe Kleine-König
2021-06-28 12:29   ` Thierry Reding
2021-06-28 16:46     ` Uwe Kleine-König
2021-07-16  7:30   ` Uwe Kleine-König
2021-06-17  9:51 ` [PATCH v1 6/6] pwm: tegra: unfold legacy callbacks into tegra_pwm_apply() Uwe Kleine-König

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=20210617095145.163694-5-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=jonathanh@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=thierry.reding@gmail.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 NNTP newsgroup(s).