From: Cosmin Tanislav Date: Wed, 27 May 2026 14:56:05 +0000 (+0300) Subject: mfd: rz-mtu3: Store &pdev->dev in local variable X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3bd9f3dd5c88c621e4bc4ecd5f2ae9c277f558a;p=thirdparty%2Flinux.git mfd: rz-mtu3: Store &pdev->dev in local variable &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 Link: https://patch.msgid.link/20260527145606.136536-4-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/rz-mtu3.c b/drivers/mfd/rz-mtu3.c index 8122355e0e296..f64c748d6ce4f 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 rz_mtu3_priv *priv; struct rz_mtu3 *ddata; struct reset_control *rstc; 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); }