Date: Sun, 24 Jun 2018 19:01:01 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335606 - head/sys/dev/bktr Message-ID: <201806241901.w5OJ111d006664@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sun Jun 24 19:01:01 2018 New Revision: 335606 URL: https://svnweb.freebsd.org/changeset/base/335606 Log: Don't use generic PCI_VENDOR and PCI_PRODUCT macros. Prefix them with BKTR_ to avoid possible conflicts. Modified: head/sys/dev/bktr/bktr_core.c head/sys/dev/bktr/bktr_os.c head/sys/dev/bktr/bktr_reg.h Modified: head/sys/dev/bktr/bktr_core.c ============================================================================== --- head/sys/dev/bktr/bktr_core.c Sun Jun 24 18:57:06 2018 (r335605) +++ head/sys/dev/bktr/bktr_core.c Sun Jun 24 19:01:01 2018 (r335606) @@ -572,9 +572,9 @@ bktr_store_address(unit, BKTR_MEM_BUF, buf); /* using the pci device id and revision id */ /* and determine the card type */ - if (PCI_VENDOR(pci_id) == PCI_VENDOR_BROOKTREE) + if (BKTR_PCI_VENDOR(pci_id) == PCI_VENDOR_BROOKTREE) { - switch (PCI_PRODUCT(pci_id)) { + switch (BKTR_PCI_PRODUCT(pci_id)) { case PCI_PRODUCT_BROOKTREE_BT848: if (rev == 0x12) bktr->id = BROOKTREE_848A; Modified: head/sys/dev/bktr/bktr_os.c ============================================================================== --- head/sys/dev/bktr/bktr_os.c Sun Jun 24 18:57:06 2018 (r335605) +++ head/sys/dev/bktr/bktr_os.c Sun Jun 24 19:01:01 2018 (r335606) @@ -287,9 +287,9 @@ bktr_probe( device_t dev ) unsigned int type = pci_get_devid(dev); unsigned int rev = pci_get_revid(dev); - if (PCI_VENDOR(type) == PCI_VENDOR_BROOKTREE) + if (BKTR_PCI_VENDOR(type) == PCI_VENDOR_BROOKTREE) { - switch (PCI_PRODUCT(type)) { + switch (BKTR_PCI_PRODUCT(type)) { case PCI_PRODUCT_BROOKTREE_BT848: if (rev == 0x12) device_set_desc(dev, "BrookTree 848A"); @@ -922,11 +922,11 @@ bktr_probe(parent, match, aux) { struct pci_attach_args *pa = aux; - if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROOKTREE && - (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT848 || - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT849 || - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT878 || - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT879)) + if (BKTR_PCI_VENDOR(pa->pa_id) == PCI_VENDOR_BROOKTREE && + (BKTR_PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT848 || + BKTR_PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT849 || + BKTR_PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT878 || + BKTR_PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_BROOKTREE_BT879)) return 1; return 0; Modified: head/sys/dev/bktr/bktr_reg.h ============================================================================== --- head/sys/dev/bktr/bktr_reg.h Sun Jun 24 18:57:06 2018 (r335605) +++ head/sys/dev/bktr/bktr_reg.h Sun Jun 24 19:01:01 2018 (r335606) @@ -88,15 +88,15 @@ * Definitions for the Brooktree 848/878 video capture to pci interface. */ #ifndef __NetBSD__ -#define PCI_VENDOR_SHIFT 0 -#define PCI_VENDOR_MASK 0xffff -#define PCI_VENDOR(id) \ - (((id) >> PCI_VENDOR_SHIFT) & PCI_VENDOR_MASK) +#define BKTR_PCI_VENDOR_SHIFT 0 +#define BKTR_PCI_VENDOR_MASK 0xffff +#define BKTR_PCI_VENDOR(id) \ + (((id) >> BKTR_PCI_VENDOR_SHIFT) & BKTR_PCI_VENDOR_MASK) -#define PCI_PRODUCT_SHIFT 16 -#define PCI_PRODUCT_MASK 0xffff -#define PCI_PRODUCT(id) \ - (((id) >> PCI_PRODUCT_SHIFT) & PCI_PRODUCT_MASK) +#define BKTR_PCI_PRODUCT_SHIFT 16 +#define BKTR_PCI_PRODUCT_MASK 0xffff +#define BKTR_PCI_PRODUCT(id) \ + (((id) >> BKTR_PCI_PRODUCT_SHIFT) & BKTR_PCI_PRODUCT_MASK) /* PCI vendor ID */ #define PCI_VENDOR_BROOKTREE 0x109e /* Brooktree */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806241901.w5OJ111d006664>