[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <31051c05581d0200a45357a6d1ab4ad268a1bbf4.1656341824.git.geert+renesas@glider.be>
Date: Mon, 27 Jun 2022 17:31:09 +0200
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Vignesh Raghavendra <vigneshr@...com>,
Sergey Shtylyov <s.shtylyov@....ru>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>
Cc: Mark Brown <broonie@...nel.org>, linux-mtd@...ts.infradead.org,
linux-renesas-soc@...r.kernel.org, linux-spi@...r.kernel.org,
linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH 2/7] memory: renesas-rpc-if: Add dev helper to rpcif_probe()
Add a helper variable pointing to the device structure, to avoid going
through the platform device every time.
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
drivers/memory/renesas-rpc-if.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 829b962e8f034bdd..2421a820e3c5880c 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -666,14 +666,15 @@ EXPORT_SYMBOL(rpcif_dirmap_read);
static int rpcif_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct platform_device *vdev;
struct device_node *flash;
const char *name;
int ret;
- flash = of_get_next_child(pdev->dev.of_node, NULL);
+ flash = of_get_next_child(dev->of_node, NULL);
if (!flash) {
- dev_warn(&pdev->dev, "no flash node found\n");
+ dev_warn(dev, "no flash node found\n");
return -ENODEV;
}
@@ -683,7 +684,7 @@ static int rpcif_probe(struct platform_device *pdev)
name = "rpc-if-hyperflash";
} else {
of_node_put(flash);
- dev_warn(&pdev->dev, "unknown flash type\n");
+ dev_warn(dev, "unknown flash type\n");
return -ENODEV;
}
of_node_put(flash);
@@ -691,7 +692,7 @@ static int rpcif_probe(struct platform_device *pdev)
vdev = platform_device_alloc(name, pdev->id);
if (!vdev)
return -ENOMEM;
- vdev->dev.parent = &pdev->dev;
+ vdev->dev.parent = dev;
platform_set_drvdata(pdev, vdev);
ret = platform_device_add(vdev);
--
2.25.1
Powered by blists - more mailing lists