RISCV: configs: tizen_visionfive2: Enable DM_BOW feature
[platform/kernel/linux-starfive.git] / drivers / mailbox / mailbox-test.c
index fc6a12a..22d6018 100644 (file)
@@ -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);
@@ -390,7 +388,7 @@ static int mbox_test_probe(struct platform_device *pdev)
        tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
        tdev->rx_channel = mbox_test_request_channel(pdev, "rx");
 
-       if (!tdev->tx_channel && !tdev->rx_channel)
+       if (IS_ERR_OR_NULL(tdev->tx_channel) && IS_ERR_OR_NULL(tdev->rx_channel))
                return -EPROBE_DEFER;
 
        /* If Rx is not specified but has Rx MMIO, then Rx = Tx */