[PATCH] PCI: s32g: Fix ports parsing

Vincent Guittot vincent.guittot at linaro.org
Mon Feb 2 05:23:52 PST 2026


On Mon, 2 Feb 2026 at 14:18, Manivannan Sadhasivam <mani at kernel.org> wrote:
>
> On Mon, Feb 02, 2026 at 02:07:56PM +0100, Vincent Guittot wrote:
> > No error return is missing after the loop resulting in removing the
> > ports from the list.
> >
> > Fixes: 5cbc7d3e316e ("PCI: s32g: Add NXP S32G PCIe controller driver (RC)")
> > Signed-off-by: Vincent Guittot <vincent.guittot at linaro.org>
> > ---
> >  drivers/pci/controller/dwc/pcie-nxp-s32g.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/pci/controller/dwc/pcie-nxp-s32g.c b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> > index 47745749f75c..767f5a622441 100644
> > --- a/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> > +++ b/drivers/pci/controller/dwc/pcie-nxp-s32g.c
> > @@ -285,6 +285,8 @@ static int s32g_pcie_parse_ports(struct device *dev, struct s32g_pcie *s32g_pp)
> >                       goto err_port;
> >       }
> >
> > +     return 0;
> > +
>
> Hmm. So the initial 'ret = -ENOENT' will become redundant and you'll return
> success even if there are no Root Ports in DT.

good point.

>
> You should do:
>
>         if (!of_get_available_child_count(dev->of_node))
>                 return -ENOENT;

or maybe

+       if (!ret)
+               return 0;

>
> at the start and remove the 'ret' initialization.
>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்



More information about the linux-arm-kernel mailing list