From: Philipp Zabel <p.zabel@pengutronix.de>
To: "Kunihiko Hayashi" <hayashi.kunihiko@socionext.com>,
"Masami Hiramatsu" <mhiramat@kernel.org>,
"Lad Prabhakar" <prabhakar.mahadev-lad.rj@bp.renesas.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de,
Philipp Zabel <p.zabel@pengutronix.de>
Subject: [PATCH RFC 3/3] reset: uniphier-glue: Use devm_reset_control_bulk_get_shared_deasserted()
Date: Fri, 21 Jun 2024 16:45:04 +0200 [thread overview]
Message-ID: <20240621-reset-get-deasserted-v1-3-94ee76fb7b7d@pengutronix.de> (raw)
In-Reply-To: <20240621-reset-get-deasserted-v1-0-94ee76fb7b7d@pengutronix.de>
Replace the pattern devm_reset_control_bulk_get_shared() /
reset_control_bulk_deassert() / devm_add_action_or_reset()
with devm_reset_control_bulk_get_shared_deasserted() for
some reduction in boilerplate.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/reset/reset-uniphier-glue.c | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
diff --git a/drivers/reset/reset-uniphier-glue.c b/drivers/reset/reset-uniphier-glue.c
index 5f9f2f7994c0..a2a262bf6bfc 100644
--- a/drivers/reset/reset-uniphier-glue.c
+++ b/drivers/reset/reset-uniphier-glue.c
@@ -35,13 +35,6 @@ static void uniphier_clk_disable(void *_priv)
clk_bulk_disable_unprepare(priv->data->nclks, priv->clk);
}
-static void uniphier_rst_assert(void *_priv)
-{
- struct uniphier_glue_reset_priv *priv = _priv;
-
- reset_control_bulk_assert(priv->data->nrsts, priv->rst);
-}
-
static int uniphier_glue_reset_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -68,13 +61,6 @@ static int uniphier_glue_reset_probe(struct platform_device *pdev)
if (ret)
return ret;
- for (i = 0; i < priv->data->nrsts; i++)
- priv->rst[i].id = priv->data->reset_names[i];
- ret = devm_reset_control_bulk_get_shared(dev, priv->data->nrsts,
- priv->rst);
- if (ret)
- return ret;
-
ret = clk_bulk_prepare_enable(priv->data->nclks, priv->clk);
if (ret)
return ret;
@@ -83,11 +69,11 @@ static int uniphier_glue_reset_probe(struct platform_device *pdev)
if (ret)
return ret;
- ret = reset_control_bulk_deassert(priv->data->nrsts, priv->rst);
- if (ret)
- return ret;
-
- ret = devm_add_action_or_reset(dev, uniphier_rst_assert, priv);
+ for (i = 0; i < priv->data->nrsts; i++)
+ priv->rst[i].id = priv->data->reset_names[i];
+ ret = devm_reset_control_bulk_get_shared_deasserted(dev,
+ priv->data->nrsts,
+ priv->rst);
if (ret)
return ret;
--
2.39.2
prev parent reply other threads:[~2024-06-21 14:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 14:45 [PATCH RFC 0/3] reset: Requesting pre-deasserted, auto-reasserting reset controls via devres Philipp Zabel
2024-06-21 14:45 ` [PATCH RFC 1/3] reset: replace boolean parameters with flags parameter Philipp Zabel
2024-06-22 7:47 ` Uwe Kleine-König
2024-06-26 16:17 ` Philipp Zabel
2024-09-25 14:25 ` Uwe Kleine-König
2024-09-25 16:43 ` Philipp Zabel
2024-06-21 14:45 ` [PATCH RFC 2/3] reset: Add devres helpers to request pre-deasserted reset controls Philipp Zabel
2024-06-21 14:45 ` Philipp Zabel [this message]
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=20240621-reset-get-deasserted-v1-3-94ee76fb7b7d@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=geert+renesas@glider.be \
--cc=hayashi.kunihiko@socionext.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=u.kleine-koenig@baylibre.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).