diff mbox

drm/kirin: Checking for IS_ERR() instead of NULL

Message ID 20171005125751.jvtjms62vbtxuvak@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Oct. 5, 2017, 12:57 p.m. UTC
The of_graph_get_remote_node() function doesn't return error pointers,
it returns NULL on error so I've updated the check.

Fixes: 86418f90a4c1 ("drm: convert drivers to use of_graph_get_remote_node")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Sean Paul Oct. 12, 2017, 2:43 p.m. UTC | #1
On Thu, Oct 5, 2017 at 8:57 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The of_graph_get_remote_node() function doesn't return error pointers,
> it returns NULL on error so I've updated the check.
>
> Fixes: 86418f90a4c1 ("drm: convert drivers to use of_graph_get_remote_node")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>

Hi Dan,
Apologies for missing this.

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index e27352ca26c4..527aa58485fa 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);
diff mbox

Patch

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index e27352ca26c4..527aa58485fa 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);