提交 06b230e3 编写于 作者: L Lucas Stach 提交者: Rafael J. Wysocki

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: NLucas Stach <dev@lynxeye.de>
Acked-by: NThomas Renninger <trenn@suse.de>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 39a88044
......@@ -25,14 +25,21 @@
struct pci_dev *pci_acc_init(struct pci_access **pacc, int domain, int bus,
int slot, int func, int vendor, int dev)
{
struct pci_filter filter_nb_link = { domain, bus, slot, func,
vendor, dev };
struct pci_filter filter_nb_link;
struct pci_dev *device;
*pacc = pci_alloc();
if (*pacc == NULL)
return NULL;
pci_filter_init(*pacc, &filter_nb_link);
filter_nb_link.domain = domain;
filter_nb_link.bus = bus;
filter_nb_link.slot = slot;
filter_nb_link.func = func;
filter_nb_link.vendor = vendor;
filter_nb_link.device = dev;
pci_init(*pacc);
pci_scan_bus(*pacc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册