Re: [PATCH v2 4/4] power: sequencing: Add the Power Sequencing driver for the PCIe M.2 connectors
From: Bartosz Golaszewski
Date: Wed Nov 12 2025 - 10:05:06 EST
On Sat, Nov 8, 2025 at 4:24 AM Manivannan Sadhasivam
<manivannan.sadhasivam@xxxxxxxxxxxxxxxx> wrote:
>
> +
> +static int pwrseq_pcie_m2_match(struct pwrseq_device *pwrseq,
> + struct device *dev)
> +{
> + struct pwrseq_pcie_m2_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
> + struct device_node *remote, *endpoint;
> +
> + /*
> + * Traverse the 'remote-endpoint' nodes and check if the remote node's
> + * parent matches the OF node of 'dev'.
> + */
> + for_each_endpoint_of_node(ctx->of_node, endpoint) {
> + remote = of_graph_get_remote_port_parent(endpoint);
> + if (remote && (remote == dev_of_node(dev))) {
> + of_node_put(remote);
> + of_node_put(endpoint);
> + return PWRSEQ_MATCH_OK;
> + }
> + of_node_put(remote);
> + }
> +
> + return PWRSEQ_NO_MATCH;
> +}
Nit: I would simplify this function with __free(device_node) since
there'll be a v3 anyway. Other than that it looks good, so when the
bindings get acked I assume this can go into the pwrseq/for-next?
There don't seem to be any build-time dependencies between this and
the PCI part.
Bart