diff options
| author | Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> | 2026-05-27 17:56:05 +0300 |
|---|---|---|
| committer | Lee Jones <lee@kernel.org> | 2026-06-17 11:33:05 +0100 |
| commit | a3bd9f3dd5c88c621e4bc4ecd5f2ae9c277f558a (patch) | |
| tree | 5e7241a3f93a46e2a5a2f34bd05c924c680b170d /drivers | |
| parent | 4bf15cafe9588d0c303143b4c64c7bfc7b1a3a5d (diff) | |
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 <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20260527145606.136536-4-cosmin-gabriel.tanislav.xa@renesas.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/mfd/rz-mtu3.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mfd/rz-mtu3.c b/drivers/mfd/rz-mtu3.c index 8122355e0e29..f64c748d6ce4 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); } |
