Skip to content

Commit 7733171

Browse files
committed
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()
2 parents 3c5c9b7 + a493208 commit 7733171

21 files changed

+37
-58
lines changed

drivers/mailbox/arm_mhu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/io.h>
1313
#include <linux/mailbox_controller.h>
1414
#include <linux/module.h>
15+
#include <linux/of.h>
1516

1617
#define INTR_STAT_OFS 0x0
1718
#define INTR_SET_OFS 0x8

drivers/mailbox/arm_mhu_db.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/mailbox_controller.h>
1616
#include <linux/module.h>
1717
#include <linux/of.h>
18-
#include <linux/of_device.h>
1918

2019
#define INTR_STAT_OFS 0x0
2120
#define INTR_SET_OFS 0x8

drivers/mailbox/bcm-flexrm-mailbox.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,16 +1501,12 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
15011501
mbox->dev = dev;
15021502
platform_set_drvdata(pdev, mbox);
15031503

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);
15061506
if (!iomem || (resource_size(iomem) < RING_REGS_SIZE)) {
15071507
ret = -ENODEV;
15081508
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)) {
15141510
ret = PTR_ERR(mbox->regs);
15151511
goto fail;
15161512
}

drivers/mailbox/bcm-pdc-mailbox.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ pdc_receive(struct pdc_state *pdcs)
694694
* pdc_tx_list_sg_add() - Add the buffers in a scatterlist to the transmit
695695
* descriptors for a given SPU. The scatterlist buffers contain the data for a
696696
* 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
698698
* @sg: Scatterlist whose buffers contain part of the SPU request
699699
*
700700
* If a scatterlist buffer is larger than PDC_DMA_BUF_MAX, multiple descriptors
@@ -861,7 +861,7 @@ static int pdc_rx_list_init(struct pdc_state *pdcs, struct scatterlist *dst_sg,
861861
* pdc_rx_list_sg_add() - Add the buffers in a scatterlist to the receive
862862
* descriptors for a given SPU. The caller must have already DMA mapped the
863863
* scatterlist.
864-
* @spu_idx: Indicates which SPU the buffers are for
864+
* @pdcs: PDC state for the SPU that will process this request
865865
* @sg: Scatterlist whose buffers are added to the receive ring
866866
*
867867
* If a receive buffer in the scatterlist is larger than PDC_DMA_BUF_MAX,
@@ -960,7 +960,7 @@ static irqreturn_t pdc_irq_handler(int irq, void *data)
960960
/**
961961
* pdc_tasklet_cb() - Tasklet callback that runs the deferred processing after
962962
* a DMA receive interrupt. Reenables the receive interrupt.
963-
* @data: PDC state structure
963+
* @t: Pointer to the Altera sSGDMA channel structure
964964
*/
965965
static void pdc_tasklet_cb(struct tasklet_struct *t)
966966
{
@@ -1566,19 +1566,13 @@ static int pdc_probe(struct platform_device *pdev)
15661566
if (err)
15671567
goto cleanup_ring_pool;
15681568

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);
15781570
if (IS_ERR(pdcs->pdc_reg_vbase)) {
15791571
err = PTR_ERR(pdcs->pdc_reg_vbase);
15801572
goto cleanup_ring_pool;
15811573
}
1574+
dev_dbg(dev, "PDC register region res.start = %pa, res.end = %pa",
1575+
&pdc_regs->start, &pdc_regs->end);
15821576

15831577
/* create rx buffer pool after dt read to know how big buffers are */
15841578
err = pdc_rx_buf_pool_create(pdcs);

drivers/mailbox/hi3660-mailbox.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/iopoll.h>
1212
#include <linux/mailbox_controller.h>
1313
#include <linux/module.h>
14+
#include <linux/of.h>
1415
#include <linux/platform_device.h>
1516
#include <linux/slab.h>
1617

drivers/mailbox/hi6220-mailbox.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/kfifo.h>
1616
#include <linux/mailbox_controller.h>
1717
#include <linux/module.h>
18+
#include <linux/of.h>
1819
#include <linux/platform_device.h>
1920
#include <linux/slab.h>
2021

drivers/mailbox/imx-mailbox.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#include <linux/kernel.h>
1515
#include <linux/mailbox_controller.h>
1616
#include <linux/module.h>
17-
#include <linux/of_device.h>
17+
#include <linux/of.h>
18+
#include <linux/platform_device.h>
1819
#include <linux/pm_runtime.h>
1920
#include <linux/suspend.h>
2021
#include <linux/slab.h>

drivers/mailbox/mailbox-mpfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/module.h>
1515
#include <linux/kernel.h>
1616
#include <linux/interrupt.h>
17+
#include <linux/mod_devicetable.h>
1718
#include <linux/platform_device.h>
1819
#include <linux/mailbox_controller.h>
1920
#include <soc/microchip/mpfs.h>

drivers/mailbox/mailbox-test.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,7 @@ static int mbox_test_probe(struct platform_device *pdev)
367367
return -ENOMEM;
368368

369369
/* 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);
372371
if (PTR_ERR(tdev->tx_mmio) == -EBUSY) {
373372
/* if reserved area in SRAM, try just ioremap */
374373
size = resource_size(res);
@@ -378,8 +377,7 @@ static int mbox_test_probe(struct platform_device *pdev)
378377
}
379378

380379
/* If specified, second reg entry is Rx MMIO */
381-
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
382-
tdev->rx_mmio = devm_ioremap_resource(&pdev->dev, res);
380+
tdev->rx_mmio = devm_platform_get_and_ioremap_resource(pdev, 1, &res);
383381
if (PTR_ERR(tdev->rx_mmio) == -EBUSY) {
384382
size = resource_size(res);
385383
tdev->rx_mmio = devm_ioremap(&pdev->dev, res->start, size);
@@ -390,7 +388,7 @@ static int mbox_test_probe(struct platform_device *pdev)
390388
tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
391389
tdev->rx_channel = mbox_test_request_channel(pdev, "rx");
392390

393-
if (!tdev->tx_channel && !tdev->rx_channel)
391+
if (IS_ERR_OR_NULL(tdev->tx_channel) && IS_ERR_OR_NULL(tdev->rx_channel))
394392
return -EPROBE_DEFER;
395393

396394
/* If Rx is not specified but has Rx MMIO, then Rx = Tx */

drivers/mailbox/mailbox.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/bitops.h>
1818
#include <linux/mailbox_client.h>
1919
#include <linux/mailbox_controller.h>
20+
#include <linux/of.h>
2021

2122
#include "mailbox.h"
2223

0 commit comments

Comments
 (0)