Linux clock framework development
 help / color / mirror / Atom feed
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 04/10] mfd: rz-mtu3: store &pdev->dev in local variable
Date: Thu, 7 May 2026 13:47:01 +0100	[thread overview]
Message-ID: <20260507124701.GK305027@google.com> (raw)
In-Reply-To: <20260410163530.383818-5-cosmin-gabriel.tanislav.xa@renesas.com>

On Fri, 10 Apr 2026, Cosmin Tanislav wrote:

> &pdev->dev is accessed multiple times during probe. Store it in a local
> variable and use that to simplify the code.
> 
> Signed-off-by: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
> ---
> 
> V2:
>  * no changes
> 
>  drivers/mfd/rz-mtu3.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

This is fine.

> diff --git a/drivers/mfd/rz-mtu3.c b/drivers/mfd/rz-mtu3.c
> index 3be6f6c900b82..37d12030e069c 100644
> --- a/drivers/mfd/rz-mtu3.c
> +++ b/drivers/mfd/rz-mtu3.c
> @@ -311,16 +311,17 @@ static const struct mfd_cell rz_mtu3_devs[] = {
>  
>  static int rz_mtu3_probe(struct platform_device *pdev)
>  {
> +	struct device *dev = &pdev->dev;
>  	struct reset_control *rstc;
>  	struct rz_mtu3_priv *priv;
>  	struct rz_mtu3 *ddata;
>  	unsigned int i;
>  
> -	ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL);
> +	ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
>  	if (!ddata)
>  		return -ENOMEM;
>  
> -	ddata->priv_data = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> +	ddata->priv_data = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
>  	if (!ddata->priv_data)
>  		return -ENOMEM;
>  
> @@ -330,11 +331,11 @@ static int rz_mtu3_probe(struct platform_device *pdev)
>  	if (IS_ERR(priv->mmio))
>  		return PTR_ERR(priv->mmio);
>  
> -	rstc = devm_reset_control_get_exclusive_deasserted(&pdev->dev, NULL);
> +	rstc = devm_reset_control_get_exclusive_deasserted(dev, NULL);
>  	if (IS_ERR(rstc))
>  		return PTR_ERR(rstc);
>  
> -	ddata->clk = devm_clk_get(&pdev->dev, NULL);
> +	ddata->clk = devm_clk_get(dev, NULL);
>  	if (IS_ERR(ddata->clk))
>  		return PTR_ERR(ddata->clk);
>  
> @@ -347,7 +348,7 @@ static int rz_mtu3_probe(struct platform_device *pdev)
>  		mutex_init(&ddata->channels[i].lock);
>  	}
>  
> -	return devm_mfd_add_devices(&pdev->dev, 0, rz_mtu3_devs,
> +	return devm_mfd_add_devices(dev, 0, rz_mtu3_devs,
>  				    ARRAY_SIZE(rz_mtu3_devs), NULL, 0, NULL);
>  }
>  
> -- 
> 2.53.0

-- 
Lee Jones

  reply	other threads:[~2026-05-07 12:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10 16:35 [PATCH v2 00/10] Add MTU3 for RZ/T2H and RZ/N2H Cosmin Tanislav
2026-04-10 16:35 ` [PATCH v2 01/10] clk: renesas: r9a09g077: add MTU3 module clock Cosmin Tanislav
2026-04-24 13:04   ` Geert Uytterhoeven
2026-04-10 16:35 ` [PATCH v2 02/10] mfd: rz-mtu3: use device-managed reset deassert Cosmin Tanislav
2026-05-07 12:39   ` Lee Jones
2026-05-07 14:19     ` Cosmin-Gabriel Tanislav
2026-04-10 16:35 ` [PATCH v2 03/10] mfd: rz-mtu3: use device-managed mfd_add_devices() Cosmin Tanislav
2026-05-07 12:46   ` Lee Jones
2026-05-07 14:20     ` Cosmin-Gabriel Tanislav
2026-04-10 16:35 ` [PATCH v2 04/10] mfd: rz-mtu3: store &pdev->dev in local variable Cosmin Tanislav
2026-05-07 12:47   ` Lee Jones [this message]
2026-04-10 16:35 ` [PATCH v2 05/10] mfd: rz-mtu3: make reset optional Cosmin Tanislav
2026-05-07 12:52   ` Lee Jones
2026-04-10 16:35 ` [PATCH v2 06/10] dt-bindings: timer: renesas,rz-mtu3: remove TCIU8 interrupt Cosmin Tanislav
2026-04-10 16:35 ` [PATCH v2 07/10] dt-bindings: timer: renesas,rz-mtu3: document RZ/{T2H,N2H} Cosmin Tanislav
2026-04-13  6:54   ` Krzysztof Kozlowski
2026-04-10 16:35 ` [PATCH v2 08/10] arm64: dts: renesas: r9a07g0{43,44,54}: remove TCIU8 interrupt from MTU3 Cosmin Tanislav
2026-04-10 16:35 ` [PATCH v2 09/10] arm64: dts: renesas: r9a09g077: add MTU3 support Cosmin Tanislav
2026-04-10 16:35 ` [PATCH v2 10/10] arm64: dts: renesas: r9a09g087: " Cosmin Tanislav
2026-04-23 11:16 ` [PATCH v2 00/10] Add MTU3 for RZ/T2H and RZ/N2H Daniel Lezcano

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=20260507124701.GK305027@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