Skip to contentSkip to conversation

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

PATCH In review Dan Carpenter 2 participants 2 messages Oct 5, 2017 – Oct 12, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

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")
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +2 -2
index e27352ca26c4..527aa58485fa 100644
@@ -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);
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

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")

Hi Dan,
Apologies for missing this.

Quoted 15 lines
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +2 -2
index e27352ca26c4..527aa58485fa 100644
@@ -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);