Skip to contentSkip to conversation

drm/rockchip: rgb: don't count non-existent devices when determining subdrivers

PATCH Applied Heiko Stuebner 2 participants 3 messages Jan 21, 2020 – Mar 11, 2020

Subsystems (4)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

PATCH 1/1 drm/rockchip: rgb: don't count non-existent devices when determining subdrivers

From: Heiko Stuebner <[email protected]>

rockchip_drm_endpoint_is_subdriver() may also return error codes. For example if the target-node is in the disabled state, so no platform-device is getting created for it.

In that case current code would count that as external rgb device, which in turn would make probing the rockchip-drm device fail.

So only count the target as rgb device if the function actually returns 0.

---
 drivers/gpu/drm/rockchip/rockchip_rgb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_rgb.c +2 -1
index ae730275a34f..79a7e60633e0 100644
@@ -98,7 +98,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
 		if (of_property_read_u32(endpoint, "reg", &endpoint_id))
 			endpoint_id = 0;
 
-		if (rockchip_drm_endpoint_is_subdriver(endpoint) > 0)
+		/* if subdriver (> 0) or error case (< 0), ignore entry */
+		if (rockchip_drm_endpoint_is_subdriver(endpoint) != 0)
 			continue;
 
 		child_count++;
Signature · 1 line
2.24.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Heiko,

Heiko Stuebner <[email protected]> wrote on Tue, 21 Jan 2020 23:48:28 +0100:

Quoted 22 lines

From: Heiko Stuebner <[email protected]>

rockchip_drm_endpoint_is_subdriver() may also return error codes. For example if the target-node is in the disabled state, so no platform-device is getting created for it.

In that case current code would count that as external rgb device, which in turn would make probing the rockchip-drm device fail.

So only count the target as rgb device if the function actually returns 0.

---
 drivers/gpu/drm/rockchip/rockchip_rgb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_rgb.c +0 -0
index ae730275a34f..79a7e60633e0 100644

drivers/gpu/drm/rockchip/rockchip_rgb.c struct rockchip_rgb *rockchip_rgb_init(struct device *dev, · line 105

Quoted 9 lines
drivers/gpu/drm/rockchip/rockchip_rgb.c +2 -1
@@ -98,7 +98,8 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,
 		if (of_property_read_u32(endpoint, "reg", &endpoint_id))
 			endpoint_id = 0;
 
-		if (rockchip_drm_endpoint_is_subdriver(endpoint) > 0)
+		/* if subdriver (> 0) or error case (< 0), ignore entry */
+		if (rockchip_drm_endpoint_is_subdriver(endpoint) != 0)
 			continue;
 
 		child_count++;

Thanks,
Miquèl

author maintainer Applied
#2 lore raw
In reply to Heiko Stuebner

Am Dienstag, 21. Januar 2020, 23:48:28 CET schrieb Heiko Stuebner:

Quoted 6 lines

From: Heiko Stuebner <[email protected]>

rockchip_drm_endpoint_is_subdriver() may also return error codes. For example if the target-node is in the disabled state, so no platform-device is getting created for it.

Quoted 7 lines

In that case current code would count that as external rgb device, which in turn would make probing the rockchip-drm device fail.

So only count the target as rgb device if the function actually returns 0.

applied to drm-misc-next