summaryrefslogtreecommitdiffstats
path: root/drivers/mailbox/mailbox-test.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2023-07-04 15:37:24 +0200
committerJassi Brar <jaswinder.singh@linaro.org>2023-09-05 17:10:42 +0200
commitf7fdb53cd2e1f39324042fd78c50f998c4ca95dc (patch)
tree50e2c621953adece50b2a9bb8291a117bb736662 /drivers/mailbox/mailbox-test.c
parentmailbox: bcm-pdc: Use devm_platform_get_and_ioremap_resource() (diff)
downloadlinux-f7fdb53cd2e1f39324042fd78c50f998c4ca95dc.tar.xz
linux-f7fdb53cd2e1f39324042fd78c50f998c4ca95dc.zip
mailbox: mailbox-test: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox/mailbox-test.c')
-rw-r--r--drivers/mailbox/mailbox-test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index fc6a12a51b40..91b68cb884cd 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -367,8 +367,7 @@ static int mbox_test_probe(struct platform_device *pdev)
return -ENOMEM;
/* It's okay for MMIO to be NULL */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- tdev->tx_mmio = devm_ioremap_resource(&pdev->dev, res);
+ tdev->tx_mmio = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (PTR_ERR(tdev->tx_mmio) == -EBUSY) {
/* if reserved area in SRAM, try just ioremap */
size = resource_size(res);
@@ -378,8 +377,7 @@ static int mbox_test_probe(struct platform_device *pdev)
}
/* If specified, second reg entry is Rx MMIO */
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- tdev->rx_mmio = devm_ioremap_resource(&pdev->dev, res);
+ tdev->rx_mmio = devm_platform_get_and_ioremap_resource(pdev, 1, &res);
if (PTR_ERR(tdev->rx_mmio) == -EBUSY) {
size = resource_size(res);
tdev->rx_mmio = devm_ioremap(&pdev->dev, res->start, size);