[PATCH 3/4] pci: add pci_is_bridge() helper
Sascha Hauer
s.hauer at pengutronix.de
Thu May 21 12:46:54 PDT 2026
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?
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list