Re: [PATCH v2 4/4] power: sequencing: Add the Power Sequencing driver for the PCIe M.2 connectors
From: Manivannan Sadhasivam
Date: Wed Nov 12 2025 - 10:51:15 EST
On Wed, Nov 12, 2025 at 04:04:51PM +0100, Bartosz Golaszewski wrote:
> 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.
>
Yes. Pwrseq patches can go independently. It won't affect functionality as well,
since I haven't submitted the devicetree changes.
- Mani
--
மணிவண்ணன் சதாசிவம்