Patchwork [v2,2/2] drm/exynos: dp: fix wrong return type

login
register
mail settings
Submitter Inki Dae
Date Dec. 2, 2015, 11:57 a.m.
Message ID <1449057472-4389-2-git-send-email-inki.dae@samsung.com>
Download mbox | patch
Permalink /patch/7745351/
State New
Headers show

Comments

Inki Dae - Dec. 2, 2015, 11:57 a.m.
This patch fixes wrong return type when dt binding of bridge device
failed.

If a board has a bridge device then of_graph_get_remote_port_parent
function shouldn't be NULL. So this patch will return a proper error
type so that the deferred probe isn't triggered.

Changelog v2:
- return -EINVAL if getting a port node failed.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_dp_core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Javier Martinez Canillas - Dec. 2, 2015, 12:03 p.m.
Hello Inki,

On 12/02/2015 08:57 AM, Inki Dae wrote:
> This patch fixes wrong return type when dt binding of bridge device
> failed.
> 
> If a board has a bridge device then of_graph_get_remote_port_parent
> function shouldn't be NULL. So this patch will return a proper error
> type so that the deferred probe isn't triggered.
> 
> Changelog v2:
> - return -EINVAL if getting a port node failed.
> 
> Signed-off-by: Inki Dae <inki.dae@samsung.com>
> ---

Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>

Best regards

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c
index 0b53045..c77fb83 100644
--- a/drivers/gpu/drm/exynos/exynos_dp_core.c
+++ b/drivers/gpu/drm/exynos/exynos_dp_core.c
@@ -1436,8 +1436,10 @@  static int exynos_dp_probe(struct platform_device *pdev)
 			of_node_put(bridge_node);
 			if (!dp->ptn_bridge)
 				return -EPROBE_DEFER;
-		} else
-			return -EPROBE_DEFER;
+		} else {
+			DRM_ERROR("no port node for bridge device.\n");
+			return -EINVAL;
+		}
 	}
 
 	pm_runtime_enable(dev);