[PATCH 3/4] pci: add pci_is_bridge() helper

Bjorn Helgaas helgaas at kernel.org
Thu May 21 13:53:36 PDT 2026


On Thu, May 21, 2026 at 07:46:54PM +0000, Sascha Hauer wrote:
> On 2026-05-21 11:23, Bjorn Helgaas wrote:
> > > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > > index f6511e0095..a2dbaf6ec2 100644
> > > --- a/include/linux/pci.h
> > > +++ b/include/linux/pci.h
> > > @@ -123,6 +123,20 @@ struct pci_dev {
> > >  };
> > >  #define	to_pci_dev(d) container_of(d, struct pci_dev, dev)
> > >  
> > > +/**
> > > + * pci_is_bridge - check if the PCI device is a bridge
> > > + * @dev: PCI device
> > > + *
> > > + * Return true if the PCI device is a bridge of PCI-to-PCI type. Masks the
> > > + * multi-function flag so a multi-function bridge is still recognised.
> > > + */
> > > +static inline bool pci_is_bridge(struct pci_dev *dev)
> > > +{
> > > +	u8 type = dev->hdr_type & PCI_HEADER_TYPE_MASK;
> > > +
> > > +	return type == PCI_HEADER_TYPE_BRIDGE;
> > > +}
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/pci.h?id=v7.0#n755
> > 
> > Am I missing something?
> 
> Yes. This is a barebox patch, not Linux. Is it a lei query that made you
> stumble upon this?

Oops, sorry.  Indeed, I do read via lei.  I notice I'm regularly
getting tripped up by patches to uboot and now barebox.  I guess I
should update my lei query.  Sorry for the noise.

Bjorn



More information about the barebox mailing list