diff options
author | Benson Leung <bleung@chromium.org> | 2015-05-04 13:36:36 -0400 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2015-05-11 23:48:21 -0400 |
commit | 2d805fc1c6b2ec09f27bcd951c2aee3da919f81a (patch) | |
tree | 295523b6586a470b8b01e91929b531cf3c0e0af4 /drivers/mailbox/omap-mailbox.c | |
parent | 05ae797566a66d159cf1e2ee11bf3f6fae40c8eb (diff) |
mailbox: Fix up error handling in mbox_request_channel()
mbox_request_channel() currently returns EBUSY in the event the controller
is not present or if of_xlate() fails, but in neither case is EBUSY really
appropriate. Return EPROBE_DEFER if the controller is not yet present
and change of_xlate() to return an ERR_PTR instead of NULL so that the
error can be propagated back to the caller of mbox_request_channel().
Signed-off-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Acked-by: Suman Anna <s-anna@ti.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox/omap-mailbox.c')
-rw-r--r-- | drivers/mailbox/omap-mailbox.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c index 03f8545ba037..a3dbfd9c6479 100644 --- a/drivers/mailbox/omap-mailbox.c +++ b/drivers/mailbox/omap-mailbox.c | |||
@@ -639,18 +639,18 @@ static struct mbox_chan *omap_mbox_of_xlate(struct mbox_controller *controller, | |||
639 | 639 | ||
640 | mdev = container_of(controller, struct omap_mbox_device, controller); | 640 | mdev = container_of(controller, struct omap_mbox_device, controller); |
641 | if (WARN_ON(!mdev)) | 641 | if (WARN_ON(!mdev)) |
642 | return NULL; | 642 | return ERR_PTR(-EINVAL); |
643 | 643 | ||
644 | node = of_find_node_by_phandle(phandle); | 644 | node = of_find_node_by_phandle(phandle); |
645 | if (!node) { | 645 | if (!node) { |
646 | pr_err("%s: could not find node phandle 0x%x\n", | 646 | pr_err("%s: could not find node phandle 0x%x\n", |
647 | __func__, phandle); | 647 | __func__, phandle); |
648 | return NULL; | 648 | return ERR_PTR(-ENODEV); |
649 | } | 649 | } |
650 | 650 | ||
651 | mbox = omap_mbox_device_find(mdev, node->name); | 651 | mbox = omap_mbox_device_find(mdev, node->name); |
652 | of_node_put(node); | 652 | of_node_put(node); |
653 | return mbox ? mbox->chan : NULL; | 653 | return mbox ? mbox->chan : ERR_PTR(-ENOENT); |
654 | } | 654 | } |
655 | 655 | ||
656 | static int omap_mbox_probe(struct platform_device *pdev) | 656 | static int omap_mbox_probe(struct platform_device *pdev) |