History

mailbox: rockchip: drop unneeded runtime pointer (pclk)

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.

Linmao Li committed 3 months ago

Commit ef24ff41 parent ded48fc1 file · +4 −4Browse files

Showing the changes to drivers/mailbox (1 of 1 file). Show all

Unified · Split

drivers/mailbox/rockchip-mailbox.c+4−4
@@ -40,7 +40,6 @@ struct rockchip_mbox_chan { · 39 unmodified lines
4040
4141 struct rockchip_mbox {
4242 struct mbox_controller mbox;
43− struct clk *pclk;
4443 void __iomem *mbox_base;
4544
4645 /* The maximum size of buf for each channel */
@@ -166,6 +165,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev) · 119 unmodified lines
166165 struct rockchip_mbox *mb;
167166 const struct rockchip_mbox_data *drv_data;
168167 struct resource *res;
168+ struct clk *pclk;
169169 int ret, irq, i;
170170
171171 if (!pdev->dev.of_node)
@@ -196,9 +196,9 @@ static int rockchip_mbox_probe(struct platform_device *pdev) · 24 unmodified lines
196196 /* Each channel has two buffers for A2B and B2A */
197197 mb->buf_size = (size_t)resource_size(res) / (drv_data->num_chans * 2);
198198
199− mb->pclk = devm_clk_get_enabled(&pdev->dev, "pclk_mailbox");
200− if (IS_ERR(mb->pclk))
201− return dev_err_probe(&pdev->dev, PTR_ERR(mb->pclk),
199+ pclk = devm_clk_get_enabled(&pdev->dev, "pclk_mailbox");
200+ if (IS_ERR(pclk))
201+ return dev_err_probe(&pdev->dev, PTR_ERR(pclk),
202202 "failed to get and enable pclk_mailbox clock\n");
203203
204204 for (i = 0; i < mb->mbox.num_chans; i++) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t