Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'mailbox-v6.6' of git://git.linaro.org/landing-teams/working/fujitsu/integration

Pull mailbox updates from Jassi Brar:

- qcom: fix incorrect num_chans counting

- mhu: Remove redundant dev_err

- bcm: fix comments

- common changes:
- convert to use devm_platform_get_and_ioremap_resource
- correct DT includes

* tag 'mailbox-v6.6' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
mailbox: qcom-ipcc: fix incorrect num_chans counting
mailbox: Explicitly include correct DT includes
mailbox: ti-msgmgr: Use devm_platform_ioremap_resource_byname()
mailbox: platform-mhu: Remove redundant dev_err()
mailbox: bcm-pdc: Fix some kernel-doc comments
mailbox: mailbox-test: Fix an error check in mbox_test_probe()
mailbox: tegra-hsp: Convert to devm_platform_ioremap_resource()
mailbox: rockchip: Use devm_platform_get_and_ioremap_resource()
mailbox: mailbox-test: Use devm_platform_get_and_ioremap_resource()
mailbox: bcm-pdc: Use devm_platform_get_and_ioremap_resource()
mailbox: bcm-ferxrm-mailbox: Use devm_platform_get_and_ioremap_resource()

+37 -58
+1
drivers/mailbox/arm_mhu.c
··· 12 12 #include <linux/io.h> 13 13 #include <linux/mailbox_controller.h> 14 14 #include <linux/module.h> 15 + #include <linux/of.h> 15 16 16 17 #define INTR_STAT_OFS 0x0 17 18 #define INTR_SET_OFS 0x8
-1
drivers/mailbox/arm_mhu_db.c
··· 15 15 #include <linux/mailbox_controller.h> 16 16 #include <linux/module.h> 17 17 #include <linux/of.h> 18 - #include <linux/of_device.h> 19 18 20 19 #define INTR_STAT_OFS 0x0 21 20 #define INTR_SET_OFS 0x8
+3 -7
drivers/mailbox/bcm-flexrm-mailbox.c
··· 1501 1501 mbox->dev = dev; 1502 1502 platform_set_drvdata(pdev, mbox); 1503 1503 1504 - /* Get resource for registers */ 1505 - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1504 + /* Get resource for registers and map registers of all rings */ 1505 + mbox->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &iomem); 1506 1506 if (!iomem || (resource_size(iomem) < RING_REGS_SIZE)) { 1507 1507 ret = -ENODEV; 1508 1508 goto fail; 1509 - } 1510 - 1511 - /* Map registers of all rings */ 1512 - mbox->regs = devm_ioremap_resource(&pdev->dev, iomem); 1513 - if (IS_ERR(mbox->regs)) { 1509 + } else if (IS_ERR(mbox->regs)) { 1514 1510 ret = PTR_ERR(mbox->regs); 1515 1511 goto fail; 1516 1512 }
+6 -12
drivers/mailbox/bcm-pdc-mailbox.c
··· 694 694 * pdc_tx_list_sg_add() - Add the buffers in a scatterlist to the transmit 695 695 * descriptors for a given SPU. The scatterlist buffers contain the data for a 696 696 * SPU request message. 697 - * @spu_idx: The index of the SPU to submit the request to, [0, max_spu) 697 + * @pdcs: PDC state for the SPU that will process this request 698 698 * @sg: Scatterlist whose buffers contain part of the SPU request 699 699 * 700 700 * If a scatterlist buffer is larger than PDC_DMA_BUF_MAX, multiple descriptors ··· 861 861 * pdc_rx_list_sg_add() - Add the buffers in a scatterlist to the receive 862 862 * descriptors for a given SPU. The caller must have already DMA mapped the 863 863 * scatterlist. 864 - * @spu_idx: Indicates which SPU the buffers are for 864 + * @pdcs: PDC state for the SPU that will process this request 865 865 * @sg: Scatterlist whose buffers are added to the receive ring 866 866 * 867 867 * If a receive buffer in the scatterlist is larger than PDC_DMA_BUF_MAX, ··· 960 960 /** 961 961 * pdc_tasklet_cb() - Tasklet callback that runs the deferred processing after 962 962 * a DMA receive interrupt. Reenables the receive interrupt. 963 - * @data: PDC state structure 963 + * @t: Pointer to the Altera sSGDMA channel structure 964 964 */ 965 965 static void pdc_tasklet_cb(struct tasklet_struct *t) 966 966 { ··· 1566 1566 if (err) 1567 1567 goto cleanup_ring_pool; 1568 1568 1569 - pdc_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1570 - if (!pdc_regs) { 1571 - err = -ENODEV; 1572 - goto cleanup_ring_pool; 1573 - } 1574 - dev_dbg(dev, "PDC register region res.start = %pa, res.end = %pa", 1575 - &pdc_regs->start, &pdc_regs->end); 1576 - 1577 - pdcs->pdc_reg_vbase = devm_ioremap_resource(&pdev->dev, pdc_regs); 1569 + pdcs->pdc_reg_vbase = devm_platform_get_and_ioremap_resource(pdev, 0, &pdc_regs); 1578 1570 if (IS_ERR(pdcs->pdc_reg_vbase)) { 1579 1571 err = PTR_ERR(pdcs->pdc_reg_vbase); 1580 1572 goto cleanup_ring_pool; 1581 1573 } 1574 + dev_dbg(dev, "PDC register region res.start = %pa, res.end = %pa", 1575 + &pdc_regs->start, &pdc_regs->end); 1582 1576 1583 1577 /* create rx buffer pool after dt read to know how big buffers are */ 1584 1578 err = pdc_rx_buf_pool_create(pdcs);
+1
drivers/mailbox/hi3660-mailbox.c
··· 11 11 #include <linux/iopoll.h> 12 12 #include <linux/mailbox_controller.h> 13 13 #include <linux/module.h> 14 + #include <linux/of.h> 14 15 #include <linux/platform_device.h> 15 16 #include <linux/slab.h> 16 17
+1
drivers/mailbox/hi6220-mailbox.c
··· 15 15 #include <linux/kfifo.h> 16 16 #include <linux/mailbox_controller.h> 17 17 #include <linux/module.h> 18 + #include <linux/of.h> 18 19 #include <linux/platform_device.h> 19 20 #include <linux/slab.h> 20 21
+2 -1
drivers/mailbox/imx-mailbox.c
··· 14 14 #include <linux/kernel.h> 15 15 #include <linux/mailbox_controller.h> 16 16 #include <linux/module.h> 17 - #include <linux/of_device.h> 17 + #include <linux/of.h> 18 + #include <linux/platform_device.h> 18 19 #include <linux/pm_runtime.h> 19 20 #include <linux/suspend.h> 20 21 #include <linux/slab.h>
+1
drivers/mailbox/mailbox-mpfs.c
··· 14 14 #include <linux/module.h> 15 15 #include <linux/kernel.h> 16 16 #include <linux/interrupt.h> 17 + #include <linux/mod_devicetable.h> 17 18 #include <linux/platform_device.h> 18 19 #include <linux/mailbox_controller.h> 19 20 #include <soc/microchip/mpfs.h>
+3 -5
drivers/mailbox/mailbox-test.c
··· 367 367 return -ENOMEM; 368 368 369 369 /* It's okay for MMIO to be NULL */ 370 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 371 - tdev->tx_mmio = devm_ioremap_resource(&pdev->dev, res); 370 + tdev->tx_mmio = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 372 371 if (PTR_ERR(tdev->tx_mmio) == -EBUSY) { 373 372 /* if reserved area in SRAM, try just ioremap */ 374 373 size = resource_size(res); ··· 377 378 } 378 379 379 380 /* If specified, second reg entry is Rx MMIO */ 380 - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); 381 - tdev->rx_mmio = devm_ioremap_resource(&pdev->dev, res); 381 + tdev->rx_mmio = devm_platform_get_and_ioremap_resource(pdev, 1, &res); 382 382 if (PTR_ERR(tdev->rx_mmio) == -EBUSY) { 383 383 size = resource_size(res); 384 384 tdev->rx_mmio = devm_ioremap(&pdev->dev, res->start, size); ··· 388 390 tdev->tx_channel = mbox_test_request_channel(pdev, "tx"); 389 391 tdev->rx_channel = mbox_test_request_channel(pdev, "rx"); 390 392 391 - if (!tdev->tx_channel && !tdev->rx_channel) 393 + if (IS_ERR_OR_NULL(tdev->tx_channel) && IS_ERR_OR_NULL(tdev->rx_channel)) 392 394 return -EPROBE_DEFER; 393 395 394 396 /* If Rx is not specified but has Rx MMIO, then Rx = Tx */
+1
drivers/mailbox/mailbox.c
··· 17 17 #include <linux/bitops.h> 18 18 #include <linux/mailbox_client.h> 19 19 #include <linux/mailbox_controller.h> 20 + #include <linux/of.h> 20 21 21 22 #include "mailbox.h" 22 23
+2 -1
drivers/mailbox/mtk-adsp-mailbox.c
··· 10 10 #include <linux/kernel.h> 11 11 #include <linux/mailbox_controller.h> 12 12 #include <linux/module.h> 13 - #include <linux/of_device.h> 13 + #include <linux/of.h> 14 + #include <linux/platform_device.h> 14 15 #include <linux/slab.h> 15 16 16 17 struct mtk_adsp_mbox_priv {
+1 -1
drivers/mailbox/mtk-cmdq-mailbox.c
··· 15 15 #include <linux/platform_device.h> 16 16 #include <linux/mailbox_controller.h> 17 17 #include <linux/mailbox/mtk-cmdq-mailbox.h> 18 - #include <linux/of_device.h> 18 + #include <linux/of.h> 19 19 20 20 #define CMDQ_OP_CODE_MASK (0xff << CMDQ_OP_CODE_SHIFT) 21 21 #define CMDQ_NUM_CMD(t) (t->cmd_buf_size / CMDQ_INST_SIZE)
+1 -1
drivers/mailbox/omap-mailbox.c
··· 16 16 #include <linux/kfifo.h> 17 17 #include <linux/err.h> 18 18 #include <linux/module.h> 19 - #include <linux/of_device.h> 19 + #include <linux/of.h> 20 20 #include <linux/platform_device.h> 21 21 #include <linux/pm_runtime.h> 22 22 #include <linux/omap-mailbox.h>
+2 -3
drivers/mailbox/platform_mhu.c
··· 15 15 #include <linux/slab.h> 16 16 #include <linux/err.h> 17 17 #include <linux/io.h> 18 + #include <linux/mod_devicetable.h> 18 19 #include <linux/module.h> 19 20 #include <linux/platform_device.h> 20 21 #include <linux/mailbox_controller.h> ··· 136 135 for (i = 0; i < MHU_CHANS; i++) { 137 136 mhu->chan[i].con_priv = &mhu->mlink[i]; 138 137 mhu->mlink[i].irq = platform_get_irq(pdev, i); 139 - if (mhu->mlink[i].irq < 0) { 140 - dev_err(dev, "failed to get irq%d\n", i); 138 + if (mhu->mlink[i].irq < 0) 141 139 return mhu->mlink[i].irq; 142 - } 143 140 mhu->mlink[i].rx_reg = mhu->base + platform_mhu_reg[i]; 144 141 mhu->mlink[i].tx_reg = mhu->mlink[i].rx_reg + TX_REG_OFFSET; 145 142 }
+1 -3
drivers/mailbox/qcom-ipcc.c
··· 227 227 ret = of_parse_phandle_with_args(client_dn, "mboxes", 228 228 "#mbox-cells", j, &curr_ph); 229 229 of_node_put(curr_ph.np); 230 - if (!ret && curr_ph.np == controller_dn) { 230 + if (!ret && curr_ph.np == controller_dn) 231 231 ipcc->num_chans++; 232 - break; 233 - } 234 232 } 235 233 } 236 234
+2 -6
drivers/mailbox/rockchip-mailbox.c
··· 8 8 #include <linux/io.h> 9 9 #include <linux/kernel.h> 10 10 #include <linux/mailbox_controller.h> 11 + #include <linux/of.h> 11 12 #include <linux/module.h> 12 - #include <linux/of_device.h> 13 13 #include <linux/platform_device.h> 14 14 15 15 #define MAILBOX_A2B_INTEN 0x00 ··· 194 194 mb->mbox.ops = &rockchip_mbox_chan_ops; 195 195 mb->mbox.txdone_irq = true; 196 196 197 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 198 - if (!res) 199 - return -ENODEV; 200 - 201 - mb->mbox_base = devm_ioremap_resource(&pdev->dev, res); 197 + mb->mbox_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); 202 198 if (IS_ERR(mb->mbox_base)) 203 199 return PTR_ERR(mb->mbox_base); 204 200
+1 -1
drivers/mailbox/sprd-mailbox.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/mailbox_controller.h> 13 13 #include <linux/module.h> 14 - #include <linux/of_device.h> 14 + #include <linux/of.h> 15 15 #include <linux/platform_device.h> 16 16 #include <linux/clk.h> 17 17
+1
drivers/mailbox/stm32-ipcc.c
··· 11 11 #include <linux/io.h> 12 12 #include <linux/mailbox_controller.h> 13 13 #include <linux/module.h> 14 + #include <linux/of.h> 14 15 #include <linux/platform_device.h> 15 16 #include <linux/pm_wakeirq.h> 16 17
+1 -4
drivers/mailbox/tegra-hsp.c
··· 8 8 #include <linux/io.h> 9 9 #include <linux/mailbox_controller.h> 10 10 #include <linux/of.h> 11 - #include <linux/of_device.h> 12 11 #include <linux/platform_device.h> 13 12 #include <linux/pm.h> 14 13 #include <linux/slab.h> ··· 727 728 static int tegra_hsp_probe(struct platform_device *pdev) 728 729 { 729 730 struct tegra_hsp *hsp; 730 - struct resource *res; 731 731 unsigned int i; 732 732 u32 value; 733 733 int err; ··· 740 742 INIT_LIST_HEAD(&hsp->doorbells); 741 743 spin_lock_init(&hsp->lock); 742 744 743 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 744 - hsp->regs = devm_ioremap_resource(&pdev->dev, res); 745 + hsp->regs = devm_platform_ioremap_resource(pdev, 0); 745 746 if (IS_ERR(hsp->regs)) 746 747 return PTR_ERR(hsp->regs); 747 748
+6 -10
drivers/mailbox/ti-msgmgr.c
··· 812 812 struct device *dev = &pdev->dev; 813 813 const struct of_device_id *of_id; 814 814 struct device_node *np; 815 - struct resource *res; 816 815 const struct ti_msgmgr_desc *desc; 817 816 struct ti_msgmgr_inst *inst; 818 817 struct ti_queue_inst *qinst; ··· 842 843 inst->dev = dev; 843 844 inst->desc = desc; 844 845 845 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 846 - desc->data_region_name); 847 - inst->queue_proxy_region = devm_ioremap_resource(dev, res); 846 + inst->queue_proxy_region = 847 + devm_platform_ioremap_resource_byname(pdev, desc->data_region_name); 848 848 if (IS_ERR(inst->queue_proxy_region)) 849 849 return PTR_ERR(inst->queue_proxy_region); 850 850 851 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 852 - desc->status_region_name); 853 - inst->queue_state_debug_region = devm_ioremap_resource(dev, res); 851 + inst->queue_state_debug_region = 852 + devm_platform_ioremap_resource_byname(pdev, desc->status_region_name); 854 853 if (IS_ERR(inst->queue_state_debug_region)) 855 854 return PTR_ERR(inst->queue_state_debug_region); 856 855 857 856 if (desc->is_sproxy) { 858 - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, 859 - desc->ctrl_region_name); 860 - inst->queue_ctrl_region = devm_ioremap_resource(dev, res); 857 + inst->queue_ctrl_region = 858 + devm_platform_ioremap_resource_byname(pdev, desc->ctrl_region_name); 861 859 if (IS_ERR(inst->queue_ctrl_region)) 862 860 return PTR_ERR(inst->queue_ctrl_region); 863 861 }
-2
drivers/mailbox/zynqmp-ipi-mailbox.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/of.h> 18 18 #include <linux/of_address.h> 19 - #include <linux/of_device.h> 20 - #include <linux/of_irq.h> 21 19 #include <linux/platform_device.h> 22 20 23 21 /* IPI agent ID any */