summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heijligen <thomas.heijligen@secunet.com>2023-03-07 20:18:36 +0100
committerThomas Heijligen <src@posteo.de>2023-03-10 15:55:29 +0000
commit0e8902f1ff2b927bb91a5e89e4fde3d8d71f6692 (patch)
tree5c648d7ecf44f2c98c221e6495d4c69602a59517
parent0e4d4eac78fbf437ba8e9b1c9d27600d2190023b (diff)
downloadflashrom-0e8902f1ff2b927bb91a5e89e4fde3d8d71f6692.tar.gz
flashrom-0e8902f1ff2b927bb91a5e89e4fde3d8d71f6692.tar.bz2
flashrom-0e8902f1ff2b927bb91a5e89e4fde3d8d71f6692.zip
pcidev: remove pcidev_getdevfn() function
This function is only called once. Move the content of the function into the caller. Change-Id: Id2983420080f75ae6992edfb032bf5c83b29c803 Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/73570 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
-rw-r--r--board_enable.c3
-rw-r--r--include/programmer.h1
-rw-r--r--pcidev.c8
3 files changed, 2 insertions, 10 deletions
diff --git a/board_enable.c b/board_enable.c
index d35b151b0..3e6a5a7c6 100644
--- a/board_enable.c
+++ b/board_enable.c
@@ -1095,11 +1095,12 @@ static int nvidia_mcp_gpio_set(int gpio, int raise)
return -1;
}
- dev = pcidev_getdevfn(dev, 1);
+ dev = pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, 1);
if (!dev) {
msg_perr("MCP SMBus controller could not be found\n");
return -1;
}
+ pci_fill_info(dev, PCI_FILL_IDENT);
devclass = pci_read_word(dev, PCI_CLASS_DEVICE);
if (devclass != 0x0C05) {
msg_perr("Unexpected device class %04x for SMBus"
diff --git a/include/programmer.h b/include/programmer.h
index d8d8b4a20..9728d8d31 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -125,7 +125,6 @@ int pci_init_common(void);
uintptr_t pcidev_readbar(struct pci_dev *dev, int bar);
struct pci_dev *pcidev_init(const struct programmer_cfg *cfg, const struct dev_entry *devs, int bar);
struct pci_dev *pcidev_scandev(struct pci_filter *filter, struct pci_dev *start);
-struct pci_dev *pcidev_getdevfn(struct pci_dev *dev, const int func);
struct pci_dev *pcidev_find_vendorclass(uint16_t vendor, uint16_t devclass);
struct pci_dev *pcidev_card_find(uint16_t vendor, uint16_t device, uint16_t card_vendor, uint16_t card_device);
struct pci_dev *pcidev_find(uint16_t vendor, uint16_t device);
diff --git a/pcidev.c b/pcidev.c
index 696510edc..68da32787 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -190,14 +190,6 @@ struct pci_dev *pcidev_find(uint16_t vendor, uint16_t device)
return pcidev_scandev(&filter, NULL);
}
-struct pci_dev *pcidev_getdevfn(struct pci_dev *dev, const int func)
-{
- struct pci_dev *const new = pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, func);
- if (new)
- pci_fill_info(new, PCI_FILL_IDENT);
- return new;
-}
-
struct pci_dev *pcidev_find_vendorclass(uint16_t vendor, uint16_t devclass)
{
struct pci_dev *temp = NULL;