From 2d805fc1c6b2ec09f27bcd951c2aee3da919f81a Mon Sep 17 00:00:00 2001 From: Benson Leung Date: Mon, 4 May 2015 10:36:36 -0700 Subject: 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 Signed-off-by: Andrew Bresticker Acked-by: Suman Anna Reviewed-by: Jon Hunter Tested-by: Jon Hunter Signed-off-by: Jassi Brar --- drivers/mailbox/omap-mailbox.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/mailbox/omap-mailbox.c') 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, mdev = container_of(controller, struct omap_mbox_device, controller); if (WARN_ON(!mdev)) - return NULL; + return ERR_PTR(-EINVAL); node = of_find_node_by_phandle(phandle); if (!node) { pr_err("%s: could not find node phandle 0x%x\n", __func__, phandle); - return NULL; + return ERR_PTR(-ENODEV); } mbox = omap_mbox_device_find(mdev, node->name); of_node_put(node); - return mbox ? mbox->chan : NULL; + return mbox ? mbox->chan : ERR_PTR(-ENOENT); } static int omap_mbox_probe(struct platform_device *pdev) -- cgit v1.2.2