summaryrefslogtreecommitdiffstats
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorMinjie Du <duminjie@vivo.com>2023-07-13 12:18:08 +0200
committerJassi Brar <jaswinder.singh@linaro.org>2023-09-05 17:10:42 +0200
commit9b63a810c6f95b65b26772f388966b85315d759f (patch)
treeb63475a4f4370335789891626ea291c9a57d9553 /drivers/mailbox
parentmailbox: tegra-hsp: Convert to devm_platform_ioremap_resource() (diff)
downloadlinux-9b63a810c6f95b65b26772f388966b85315d759f.tar.xz
linux-9b63a810c6f95b65b26772f388966b85315d759f.zip
mailbox: mailbox-test: Fix an error check in mbox_test_probe()
mbox_test_request_channel() function returns NULL or error value embedded in the pointer (PTR_ERR). Evaluate the return value using IS_ERR_OR_NULL. Signed-off-by: Minjie Du <duminjie@vivo.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/mailbox-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index 91b68cb884cd..22d6018ceec3 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -388,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 */