diff mbox series

[1/7] memory: renesas-rpc-if: Always use dev in rpcif_sw_init()

Message ID 98924121e59ab3f389ddd413b6d252a8deb889cf.1656341824.git.geert+renesas@glider.be (mailing list archive)
State New, archived
Headers show
Series memory: renesas-rpc-if: Rebind and s2ram fixes | expand

Commit Message

Geert Uytterhoeven June 27, 2022, 3:31 p.m. UTC
rpcif_sw_init() already has the "dev" parameter pointing to the right
device structure, so there is no need to take a detour through the
platform device.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/memory/renesas-rpc-if.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 4316988d791a527f..829b962e8f034bdd 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -263,22 +263,21 @@  int rpcif_sw_init(struct rpcif *rpc, struct device *dev)
 	if (IS_ERR(rpc->base))
 		return PTR_ERR(rpc->base);
 
-	rpc->regmap = devm_regmap_init(&pdev->dev, NULL, rpc, &rpcif_regmap_config);
+	rpc->regmap = devm_regmap_init(dev, NULL, rpc, &rpcif_regmap_config);
 	if (IS_ERR(rpc->regmap)) {
-		dev_err(&pdev->dev,
-			"failed to init regmap for rpcif, error %ld\n",
+		dev_err(dev, "failed to init regmap for rpcif, error %ld\n",
 			PTR_ERR(rpc->regmap));
 		return	PTR_ERR(rpc->regmap);
 	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dirmap");
-	rpc->dirmap = devm_ioremap_resource(&pdev->dev, res);
+	rpc->dirmap = devm_ioremap_resource(dev, res);
 	if (IS_ERR(rpc->dirmap))
 		return PTR_ERR(rpc->dirmap);
 	rpc->size = resource_size(res);
 
 	rpc->type = (uintptr_t)of_device_get_match_data(dev);
-	rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
+	rpc->rstc = devm_reset_control_get_exclusive(dev, NULL);
 
 	return PTR_ERR_OR_ZERO(rpc->rstc);
 }