Skip to content

Commit 9b63a81

Browse files
Minjie DuJassiBrar
authored andcommitted
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>
1 parent fb5bda8 commit 9b63a81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mailbox/mailbox-test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static int mbox_test_probe(struct platform_device *pdev)
388388
tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
389389
tdev->rx_channel = mbox_test_request_channel(pdev, "rx");
390390

391-
if (!tdev->tx_channel && !tdev->rx_channel)
391+
if (IS_ERR_OR_NULL(tdev->tx_channel) && IS_ERR_OR_NULL(tdev->rx_channel))
392392
return -EPROBE_DEFER;
393393

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

0 commit comments

Comments
 (0)