mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-15 11:28:36 +10:00
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>
This commit is contained in:
parent
fb5bda8cde
commit
9b63a810c6
@ -388,7 +388,7 @@ static int mbox_test_probe(struct platform_device *pdev)
|
|||||||
tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
|
tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
|
||||||
tdev->rx_channel = mbox_test_request_channel(pdev, "rx");
|
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;
|
return -EPROBE_DEFER;
|
||||||
|
|
||||||
/* If Rx is not specified but has Rx MMIO, then Rx = Tx */
|
/* If Rx is not specified but has Rx MMIO, then Rx = Tx */
|
||||||
|
Loading…
Reference in New Issue
Block a user