src: Make PCI ID define names shorter
Shorten define names containing PCI_{DEVICE,VENDOR}_ID_ with
PCI_{DID,VID}_ using the commands below, which also take care of some
spacing issues. An additional clean up of pci_ids.h is done in
CB:61531.
Used commands:
* find -type f -exec sed -i 's/PCI_\([DV]\)\(EVICE\|ENDOR\)_ID_\([_0-9A-Za-z]\{2\}\([_0-9A-Za-z]\{8\}\)*[_0-9A-Za-z]\{0,5\}\)\t/PCI_\1ID_\3\t\t/g'
* find -type f -exec sed -i 's/PCI_\([DV]\)\(EVICE\|ENDOR\)_ID_\([_0-9A-Za-z]*\)/PCI_\1ID_\3/g'
Change-Id: If9027700f53b6d0d3964c26a41a1f9b8f62be178
Signed-off-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/39331
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
diff --git a/src/southbridge/amd/agesa/hudson/hda.c b/src/southbridge/amd/agesa/hudson/hda.c
index a15b045..a63d52a 100644
--- a/src/southbridge/amd/agesa/hudson/hda.c
+++ b/src/southbridge/amd/agesa/hudson/hda.c
@@ -20,6 +20,6 @@
static const struct pci_driver hdaaudio_driver __pci_driver = {
.ops = &hda_audio_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_HDA,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_HDA,
};
diff --git a/src/southbridge/amd/agesa/hudson/hudson.c b/src/southbridge/amd/agesa/hudson/hudson.c
index 3c34e98..f95b2fb 100644
--- a/src/southbridge/amd/agesa/hudson/hudson.c
+++ b/src/southbridge/amd/agesa/hudson/hudson.c
@@ -44,7 +44,7 @@
if (dev->enabled == 0) {
u32 usb_device_id = pci_read_config16(dev, PCI_DEVICE_ID);
u8 reg8;
- if (usb_device_id == PCI_DEVICE_ID_AMD_SB900_USB_20_5) {
+ if (usb_device_id == PCI_DID_AMD_SB900_USB_20_5) {
/* turn off and remove device 0:14.5 from PCI space */
reg8 = pm_read8(0xef);
reg8 &= ~(1 << 6);
@@ -58,12 +58,11 @@
u32 sd_device_id = pci_read_config16(dev, PCI_DEVICE_ID);
/* turn off the SDHC controller in the PM reg */
u8 reg8;
- if (sd_device_id == PCI_DEVICE_ID_AMD_HUDSON_SD) {
+ if (sd_device_id == PCI_DID_AMD_HUDSON_SD) {
reg8 = pm_read8(0xe7);
reg8 &= ~(1 << 0);
pm_write8(0xe7, reg8);
- }
- else if (sd_device_id == PCI_DEVICE_ID_AMD_YANGTZE_SD) {
+ } else if (sd_device_id == PCI_DID_AMD_YANGTZE_SD) {
reg8 = pm_read8(0xe8);
reg8 &= ~(1 << 0);
pm_write8(0xe8, reg8);
diff --git a/src/southbridge/amd/agesa/hudson/ide.c b/src/southbridge/amd/agesa/hudson/ide.c
index 8ba7a12..eaf40b5 100644
--- a/src/southbridge/amd/agesa/hudson/ide.c
+++ b/src/southbridge/amd/agesa/hudson/ide.c
@@ -19,6 +19,6 @@
static const struct pci_driver ide_driver __pci_driver = {
.ops = &ide_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_IDE,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_IDE,
};
diff --git a/src/southbridge/amd/agesa/hudson/lpc.c b/src/southbridge/amd/agesa/hudson/lpc.c
index 6a31fbf..8010f01 100644
--- a/src/southbridge/amd/agesa/hudson/lpc.c
+++ b/src/southbridge/amd/agesa/hudson/lpc.c
@@ -343,6 +343,6 @@
};
static const struct pci_driver lpc_driver __pci_driver = {
.ops = &lpc_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_LPC,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_LPC,
};
diff --git a/src/southbridge/amd/agesa/hudson/pci.c b/src/southbridge/amd/agesa/hudson/pci.c
index 5e828f7..b99413c 100644
--- a/src/southbridge/amd/agesa/hudson/pci.c
+++ b/src/southbridge/amd/agesa/hudson/pci.c
@@ -41,6 +41,6 @@
static const struct pci_driver pci_driver __pci_driver = {
.ops = &pci_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_PCI,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_PCI,
};
diff --git a/src/southbridge/amd/agesa/hudson/pcie.c b/src/southbridge/amd/agesa/hudson/pcie.c
index d79dbb9..04827a4 100644
--- a/src/southbridge/amd/agesa/hudson/pcie.c
+++ b/src/southbridge/amd/agesa/hudson/pcie.c
@@ -25,22 +25,22 @@
static const struct pci_driver pciea_driver __pci_driver = {
.ops = &pci_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_PCIEA,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_PCIEA,
};
static const struct pci_driver pcieb_driver __pci_driver = {
.ops = &pci_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_PCIEB,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_PCIEB,
};
static const struct pci_driver pciec_driver __pci_driver = {
.ops = &pci_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_PCIEC,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_PCIEC,
};
static const struct pci_driver pcied_driver __pci_driver = {
.ops = &pci_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_PCIED,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_PCIED,
};
diff --git a/src/southbridge/amd/agesa/hudson/sata.c b/src/southbridge/amd/agesa/hudson/sata.c
index a8d3865..c2348a9 100644
--- a/src/southbridge/amd/agesa/hudson/sata.c
+++ b/src/southbridge/amd/agesa/hudson/sata.c
@@ -53,12 +53,12 @@
static const struct pci_driver sata0_driver __pci_driver = {
.ops = &sata_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_SATA,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_SATA,
};
static const struct pci_driver sata0_driver_ahci __pci_driver = {
.ops = &sata_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_SATA_AHCI,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_SATA_AHCI,
};
diff --git a/src/southbridge/amd/agesa/hudson/sd.c b/src/southbridge/amd/agesa/hudson/sd.c
index f07a2e7..f3ea0a5e 100644
--- a/src/southbridge/amd/agesa/hudson/sd.c
+++ b/src/southbridge/amd/agesa/hudson/sd.c
@@ -46,6 +46,6 @@
static const struct pci_driver sd_driver __pci_driver = {
.ops = &sd_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_YANGTZE_SD,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_YANGTZE_SD,
};
diff --git a/src/southbridge/amd/agesa/hudson/sm.c b/src/southbridge/amd/agesa/hudson/sm.c
index 6f9e03c..8fd124a 100644
--- a/src/southbridge/amd/agesa/hudson/sm.c
+++ b/src/southbridge/amd/agesa/hudson/sm.c
@@ -105,6 +105,6 @@
};
static const struct pci_driver smbus_driver __pci_driver = {
.ops = &smbus_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_SM,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_SM,
};
diff --git a/src/southbridge/amd/agesa/hudson/usb.c b/src/southbridge/amd/agesa/hudson/usb.c
index 1175f08..694f2bf 100644
--- a/src/southbridge/amd/agesa/hudson/usb.c
+++ b/src/southbridge/amd/agesa/hudson/usb.c
@@ -20,18 +20,18 @@
static const struct pci_driver usb_0_driver __pci_driver = {
.ops = &usb_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_USB_18_0,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_USB_18_0,
};
static const struct pci_driver usb_1_driver __pci_driver = {
.ops = &usb_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_USB_18_2,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_USB_18_2,
};
static const struct pci_driver usb_4_driver __pci_driver = {
.ops = &usb_ops,
- .vendor = PCI_VENDOR_ID_AMD,
- .device = PCI_DEVICE_ID_AMD_SB900_USB_20_5,
+ .vendor = PCI_VID_AMD,
+ .device = PCI_DID_AMD_SB900_USB_20_5,
};