[PATCH v3 10/13] power: sequencing: pcie-m2: support matching on remote "port" node

Andy Shevchenko andriy.shevchenko at linux.intel.com
Fri Jul 3 05:57:08 PDT 2026


On Fri, Jul 03, 2026 at 07:03:11PM +0800, Chen-Yu Tsai wrote:
> A USB hub can have multiple ports, and this driver needs to
> differentiate which port is being matched to. The USB hub driver now
> associates the "port" node with the usb_port device, so here we can
> use the remote "port" node to check for a match. Then fall back to
> the remote device node for the other connection types.
> 
> Also rewrite the existing "remote == dev_of_node(dev)" with
> device_match_of_node() for consistency.

...

>  	for_each_endpoint_of_node(ctx->of_node, endpoint) {
> +		/* USB port devices are tied to the port nodes. */
> +		struct device_node *remote_port __free(device_node) =
> +				of_graph_get_remote_port(endpoint);
> +
> +		if (remote_port && device_match_of_node(dev, remote_port))

Dup NULL check. _match_of_node() already does that and it seems follows
the same logic here. So dropping it should not change how it functions.

> +			return PWRSEQ_MATCH_OK;
> +
> +		/* Try the remote port parent for other types. */
>  		struct device_node *remote __free(device_node) =
>  				of_graph_get_remote_port_parent(endpoint);
> -		if (remote && (remote == dev_of_node(dev)))
> +
> +		if (remote && device_match_of_node(dev, remote))

Ditto.

>  			return PWRSEQ_MATCH_OK;
>  	}

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list