[PATCH v14 7/9] drm/rockchip: cdn-dp: Add multiple bridges to support PHY port selection

Luca Ceresoli luca.ceresoli at bootlin.com
Tue Mar 3 00:52:49 PST 2026


Hello Chaoyi,

On Tue Mar 3, 2026 at 1:44 AM CET, Chaoyi Chen wrote:
>>> +static int cdn_dp_parse_next_bridge_dt(struct cdn_dp_device *dp)
>>> +{
>>> +	struct device_node *np = dp->dev->of_node;
>>> +	struct device_node *port __free(device_node) = of_graph_get_port_by_id(np, 1);
>>> +	struct drm_bridge *bridge;
>>> +	int count = 0;
>>> +	int ret = 0;
>>> +	int i;
>>> +
>>> +	/* If device use extcon, do not use hpd bridge */
>>> +	for (i = 0; i < dp->ports; i++) {
>>> +		if (dp->port[i]->extcon) {
>>> +			dp->bridge_count = 1;
>>> +			return 0;
>>> +		}
>>> +	}
>>> +
>>> +	/* One endpoint may correspond to one next bridge. */
>>> +	for_each_of_graph_port_endpoint(port, dp_ep) {
>>> +		struct device_node *next_bridge_node __free(device_node) =
>>> +			of_graph_get_remote_port_parent(dp_ep);
>>> +
>>> +		bridge = of_drm_find_bridge(next_bridge_node);
>>> +		if (!bridge) {
>>> +			ret = -EPROBE_DEFER;
>>> +			goto out;
>>> +		}
>>> +
>>> +		drm_bridge_get(bridge);
>>> +		dp->next_bridge_valid = true;
>>> +		dp->next_bridge_list[count] = bridge;
>>
>> Correct, but the drm_bridge_get() slightly far away from the assignement is
>> a bit misleading. I hadn't seen it initially so I suspected a missing get.
>>
>> I suggest to do it in a single statement, for clarity:
>>
>> 		dp->next_bridge_list[count] = bridgedrm_bridge_get(bridge);
>>
>
> I think the bridgedrm_bridge_get here seems to be a typo?

Oops, of course! :)

As you probably guessed, I was meaning:

		dp->next_bridge_list[count] = drm_bridge_get(bridge);


> Anyway, thank you very much for your efforts on the bridge lifetime.
> I will fix this in the next version :)

Thanks!

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the Linux-rockchip mailing list