lkml.org 
[lkml]   [2017]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drm: Fix return value check in kirin_drm_platform_probe()
Date
In case of error, the function of_graph_get_remote_node() returns NULL
pointer not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test..

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index e27352c..527aa58 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -236,8 +236,8 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
}

remote = of_graph_get_remote_node(np, 0, 0);
- if (IS_ERR(remote))
- return PTR_ERR(remote);
+ if (!remote)
+ return -ENODEV;

drm_of_component_match_add(dev, &match, compare_of, remote);
of_node_put(remote);


\
 
 \ /
  Last update: 2017-10-11 13:14    [W:0.061 / U:0.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site