[PATCH 2/2] mailbox: rockchip: drop unneeded runtime pointer (pclk)

Linmao Li <[email protected]>
Newsgroups org.infradead.lists.linux-rockchip,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
The pclk pointer is only used in rockchip_mbox_probe() and is not needed
after probe completes.

Make it a local variable and drop it from struct rockchip_mbox, which
saves a little bit of runtime memory.

Signed-off-by: Linmao Li <[email protected]>
---
 drivers/mailbox/rockchip-mailbox.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mailbox/rockchip-mailbox.c b/drivers/mailbox/rockchip-mailbox.c
index d55cbf7f2cb6..bc2f9dd798dd 100644
--- a/drivers/mailbox/rockchip-mailbox.c
+++ b/drivers/mailbox/rockchip-mailbox.c
@@ -40,7 +40,6 @@ struct rockchip_mbox_chan {
 
 struct rockchip_mbox {
 	struct mbox_controller mbox;
-	struct clk *pclk;
 	void __iomem *mbox_base;
 
 	/* The maximum size of buf for each channel */
@@ -166,6 +165,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev)
 	struct rockchip_mbox *mb;
 	const struct rockchip_mbox_data *drv_data;
 	struct resource *res;
+	struct clk *pclk;
 	int ret, irq, i;
 
 	if (!pdev->dev.of_node)
@@ -196,9 +196,9 @@ static int rockchip_mbox_probe(struct platform_device *pdev)
 	/* Each channel has two buffers for A2B and B2A */
 	mb->buf_size = (size_t)resource_size(res) / (drv_data->num_chans * 2);
 
-	mb->pclk = devm_clk_get_enabled(&pdev->dev, "pclk_mailbox");
-	if (IS_ERR(mb->pclk))
-		return dev_err_probe(&pdev->dev, PTR_ERR(mb->pclk),
+	pclk = devm_clk_get_enabled(&pdev->dev, "pclk_mailbox");
+	if (IS_ERR(pclk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(pclk),
 				     "failed to get and enable pclk_mailbox clock\n");
 
 	for (i = 0; i < mb->mbox.num_chans; i++) {
-- 
2.25.1


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.