From: Lee Jones <lee@kernel.org>
To: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Cc: Biju Das <biju.das.jz@bp.renesas.com>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Thomas Gleixner <tglx@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
linux-iio@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 02/10] mfd: rz-mtu3: use device-managed reset deassert
Date: Thu, 7 May 2026 13:39:03 +0100 [thread overview]
Message-ID: <20260507123903.GI305027@google.com> (raw)
In-Reply-To: <20260410163530.383818-3-cosmin-gabriel.tanislav.xa@renesas.com>
On Fri, 10 Apr 2026, Cosmin Tanislav wrote:
> Replace devm_reset_control_get_exclusive() and the manual
> reset_control_deassert()/reset_control_assert() with handling by
> devm_reset_control_get_exclusive_deasserted().
>
> While at it, remove struct rz_mtu3_priv::rstc and use a local variable
> for it as it is not needed inside rz_mtu3_reset_assert().
>
> Rename rz_mtu3_reset_assert() to rz_mtu3_mfd_remove() to accurately
> describe its usage since it no longer calls reset_control_assert().
>
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
> ---
>
> V2:
> * no changes
>
> drivers/mfd/rz-mtu3.c | 23 +++++++----------------
> 1 file changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/mfd/rz-mtu3.c b/drivers/mfd/rz-mtu3.c
> index 9cdfef610398f..6b9c6831dffa9 100644
> --- a/drivers/mfd/rz-mtu3.c
> +++ b/drivers/mfd/rz-mtu3.c
> @@ -21,7 +21,6 @@
>
> struct rz_mtu3_priv {
> void __iomem *mmio;
> - struct reset_control *rstc;
> spinlock_t lock;
> };
>
> @@ -301,13 +300,9 @@ void rz_mtu3_disable(struct rz_mtu3_channel *ch)
> }
> EXPORT_SYMBOL_GPL(rz_mtu3_disable);
>
> -static void rz_mtu3_reset_assert(void *data)
> +static void rz_mtu3_mfd_remove(void *data)
Remove any mention of "mfd".
> {
> - struct rz_mtu3 *mtu = dev_get_drvdata(data);
> - struct rz_mtu3_priv *priv = mtu->priv_data;
> -
> mfd_remove_devices(data);
Why not use devm_mfd_add_devices() instead?
> - reset_control_assert(priv->rstc);
> }
>
> static const struct mfd_cell rz_mtu3_devs[] = {
> @@ -321,6 +316,7 @@ static const struct mfd_cell rz_mtu3_devs[] = {
>
> static int rz_mtu3_probe(struct platform_device *pdev)
> {
> + struct reset_control *rstc;
This shouldn't go above the main device data structs.
> struct rz_mtu3_priv *priv;
> struct rz_mtu3 *ddata;
> unsigned int i;
> @@ -340,15 +336,14 @@ static int rz_mtu3_probe(struct platform_device *pdev)
> if (IS_ERR(priv->mmio))
> return PTR_ERR(priv->mmio);
>
> - priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
> - if (IS_ERR(priv->rstc))
> - return PTR_ERR(priv->rstc);
> + rstc = devm_reset_control_get_exclusive_deasserted(&pdev->dev, NULL);
> + if (IS_ERR(rstc))
> + return PTR_ERR(rstc);
>
> ddata->clk = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(ddata->clk))
> return PTR_ERR(ddata->clk);
>
> - reset_control_deassert(priv->rstc);
> spin_lock_init(&priv->lock);
> platform_set_drvdata(pdev, ddata);
>
> @@ -361,14 +356,10 @@ static int rz_mtu3_probe(struct platform_device *pdev)
> ret = mfd_add_devices(&pdev->dev, 0, rz_mtu3_devs,
> ARRAY_SIZE(rz_mtu3_devs), NULL, 0, NULL);
> if (ret < 0)
> - goto err_assert;
> + return ret;
>
> - return devm_add_action_or_reset(&pdev->dev, rz_mtu3_reset_assert,
> + return devm_add_action_or_reset(&pdev->dev, rz_mtu3_mfd_remove,
> &pdev->dev);
> -
> -err_assert:
> - reset_control_assert(priv->rstc);
> - return ret;
> }
>
> static const struct of_device_id rz_mtu3_of_match[] = {
> --
> 2.53.0
--
Lee Jones
next parent reply other threads:[~2026-05-07 12:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260410163530.383818-1-cosmin-gabriel.tanislav.xa@renesas.com>
[not found] ` <20260410163530.383818-3-cosmin-gabriel.tanislav.xa@renesas.com>
2026-05-07 12:39 ` Lee Jones [this message]
2026-05-07 14:19 ` [PATCH v2 02/10] mfd: rz-mtu3: use device-managed reset deassert Cosmin-Gabriel Tanislav
[not found] ` <20260410163530.383818-4-cosmin-gabriel.tanislav.xa@renesas.com>
2026-05-07 12:46 ` [PATCH v2 03/10] mfd: rz-mtu3: use device-managed mfd_add_devices() Lee Jones
2026-05-07 14:20 ` Cosmin-Gabriel Tanislav
[not found] ` <20260410163530.383818-5-cosmin-gabriel.tanislav.xa@renesas.com>
2026-05-07 12:47 ` [PATCH v2 04/10] mfd: rz-mtu3: store &pdev->dev in local variable Lee Jones
[not found] ` <20260410163530.383818-6-cosmin-gabriel.tanislav.xa@renesas.com>
2026-05-07 12:52 ` [PATCH v2 05/10] mfd: rz-mtu3: make reset optional Lee Jones
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=20260507123903.GI305027@google.com \
--to=lee@kernel.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=cosmin-gabriel.tanislav.xa@renesas.com \
--cc=daniel.lezcano@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tglx@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