aboutsummaryrefslogtreecommitdiffstats
path: root/tools/power
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2015-04-13 16:24:01 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-04-15 15:54:26 -0400
commit06b230e3dd46e3e45fb57990b09007c7cd071515 (patch)
tree2c26c2e194ce2ea7ccf384e1056372bcef53c315 /tools/power
parent39a8804455fb23f09157341d3ba7db6d7ae6ee76 (diff)
cpupower: fix breakage from libpci API change
libpci 3.3.0 introduced an additional member in the pci_filter struct which needs to be initialized to -1 to get the same behavior as before the API change. The libpci internal helpers got updated accordingly, but as the cpupower pci helpers initialized the struct themselves the behavior changed. Use the libpci helper pci_filter_init() to fix this and guard against similar breakages in the future. This fixes probing of the AMD fam12h/14h cpuidle monitor on systems with libpci >= 3.3.0. Signed-off-by: Lucas Stach <dev@lynxeye.de> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/cpupower/utils/helpers/pci.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/power/cpupower/utils/helpers/pci.c b/tools/power/cpupower/utils/helpers/pci.c
index 9690798e6446..8b278983cfc5 100644
--- a/tools/power/cpupower/utils/helpers/pci.c
+++ b/tools/power/cpupower/utils/helpers/pci.c
@@ -25,14 +25,21 @@
25struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus, 25struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus,
26 int slot, int func, int vendor, int dev) 26 int slot, int func, int vendor, int dev)
27{ 27{
28 struct pci_filter filter_nb_link = { domain, bus, slot, func, 28 struct pci_filter filter_nb_link;
29 vendor, dev };
30 struct pci_dev *device; 29 struct pci_dev *device;
31 30
32 *pacc = pci_alloc(); 31 *pacc = pci_alloc();
33 if (*pacc == NULL) 32 if (*pacc == NULL)
34 return NULL; 33 return NULL;
35 34
35 pci_filter_init(*pacc, &filter_nb_link);
36 filter_nb_link.domain = domain;
37 filter_nb_link.bus = bus;
38 filter_nb_link.slot = slot;
39 filter_nb_link.func = func;
40 filter_nb_link.vendor = vendor;
41 filter_nb_link.device = dev;
42
36 pci_init(*pacc); 43 pci_init(*pacc);
37 pci_scan_bus(*pacc); 44 pci_scan_bus(*pacc);
38 45