Skip to contentSkip to conversation

drm/bridge: ti-sn65dsi83: Convert to drm_of_get_data_lanes_count

PATCH In review Marek Vasut 2 participants 2 messages Jun 12, 2022

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

PATCH v3 1/1 drm/bridge: ti-sn65dsi83: Convert to drm_of_get_data_lanes_count

Convert driver to use this new helper to standardize OF "data-lanes" parsing.

Cc Andrzej Hajda <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>

To: [email protected]
---
V2: - Rename drm_of_get_data_lanes{,_ep} to drm_of_get_data_lanes_count{,_ep}
- Add RB from Andrzej
V3: - Rebase on latest next

---
 drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
index 8bf99b32776e2..b27c0d7c451ad 100644
@@ -620,7 +620,7 @@ static int sn65dsi83_host_attach(struct sn65dsi83 *ctx)
 	int dsi_lanes, ret;
 
 	endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
-	dsi_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
+	dsi_lanes = drm_of_get_data_lanes_count(endpoint, 1, 4);
 	host_node = of_graph_get_remote_port_parent(endpoint);
 	host = of_find_mipi_dsi_host_by_node(host_node);
 	of_node_put(host_node);
Signature · 1 line
2.35.1
Acked-by on v3 1/1
#1 lore raw

Hi Marek,

Quoted 11 lines · Marek Vasut

Convert driver to use this new helper to standardize OF "data-lanes" parsing.

Cc Andrzej Hajda <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Lucas Stach <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Robert Foss <[email protected]>
Cc Sam Ravnborg <[email protected]>
Quoted 1 line

To: [email protected]

Looks fine.

I wondered why the _ep variant could not be used, but endpoint is required later and there is no need to look it up twice.

Sam

Quoted 23 lines

---
V2: - Rename drm_of_get_data_lanes{,_ep} to drm_of_get_data_lanes_count{,_ep}
- Add RB from Andrzej
V3: - Rebase on latest next

---
 drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -1
index 8bf99b32776e2..b27c0d7c451ad 100644
@@ -620,7 +620,7 @@ static int sn65dsi83_host_attach(struct sn65dsi83 *ctx)
 	int dsi_lanes, ret;
 
 	endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
-	dsi_lanes = of_property_count_u32_elems(endpoint, "data-lanes");
+	dsi_lanes = drm_of_get_data_lanes_count(endpoint, 1, 4);
 	host_node = of_graph_get_remote_port_parent(endpoint);
 	host = of_find_mipi_dsi_host_by_node(host_node);
 	of_node_put(host_node);
Signature · 1 line
2.35.1