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.
Showing the changes to drivers/mailbox (1 of 1 file). Show all
Unified · Split
| @@ -40,7 +40,6 @@ struct rockchip_mbox_chan { · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | struct rockchip_mbox { | 41 | struct rockchip_mbox { |
| 42 | struct mbox_controller mbox; | 42 | struct mbox_controller mbox; |
| 43 | struct clk *pclk; | ||
| 44 | void __iomem *mbox_base; | 43 | void __iomem *mbox_base; |
| 45 | 44 | ||
| 46 | /* The maximum size of buf for each channel */ | 45 | /* The maximum size of buf for each channel */ |
| @@ -166,6 +165,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev) · 119 unmodified lines | |||
| 166 | struct rockchip_mbox *mb; | 165 | struct rockchip_mbox *mb; |
| 167 | const struct rockchip_mbox_data *drv_data; | 166 | const struct rockchip_mbox_data *drv_data; |
| 168 | struct resource *res; | 167 | struct resource *res; |
| 168 | struct clk *pclk; | ||
| 169 | int ret, irq, i; | 169 | int ret, irq, i; |
| 170 | 170 | ||
| 171 | if (!pdev->dev.of_node) | 171 | if (!pdev->dev.of_node) |
| @@ -196,9 +196,9 @@ static int rockchip_mbox_probe(struct platform_device *pdev) · 24 unmodified lines | |||
| 196 | /* Each channel has two buffers for A2B and B2A */ | 196 | /* Each channel has two buffers for A2B and B2A */ |
| 197 | mb->buf_size = (size_t)resource_size(res) / (drv_data->num_chans * 2); | 197 | mb->buf_size = (size_t)resource_size(res) / (drv_data->num_chans * 2); |
| 198 | 198 | ||
| 199 | mb->pclk = devm_clk_get_enabled(&pdev->dev, "pclk_mailbox"); | 199 | pclk = devm_clk_get_enabled(&pdev->dev, "pclk_mailbox"); |
| 200 | if (IS_ERR(mb->pclk)) | 200 | if (IS_ERR(pclk)) |
| 201 | return dev_err_probe(&pdev->dev, PTR_ERR(mb->pclk), | 201 | return dev_err_probe(&pdev->dev, PTR_ERR(pclk), |
| 202 | "failed to get and enable pclk_mailbox clock\n"); | 202 | "failed to get and enable pclk_mailbox clock\n"); |
| 203 | 203 | ||
| 204 | for (i = 0; i < mb->mbox.num_chans; i++) { | 204 | for (i = 0; i < mb->mbox.num_chans; i++) { |