[igt-dev] [PATCH i-g-t] lib: Make igt_device_get_pci_addr non-static.
Katarzyna Dec
katarzyna.dec at intel.com
Thu Mar 21 09:53:39 UTC 2019
Let's make igt_pci_addr struct and igt_device_get_pci_addr
non-static to be able to use them in tests.
Signed-off-by: Katarzyna Dec <katarzyna.dec at intel.com>
Cc: Michal Winiarski <michal.winiarski at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
lib/igt_device.c | 9 +--------
lib/igt_device.h | 8 ++++++++
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/lib/igt_device.c b/lib/igt_device.c
index a2f9bb3a..fec84609 100644
--- a/lib/igt_device.c
+++ b/lib/igt_device.c
@@ -130,14 +130,7 @@ static bool igt_device_is_pci(int fd)
return strcmp(subsystem, "/pci") == 0;
}
-struct igt_pci_addr {
- unsigned int domain;
- unsigned int bus;
- unsigned int device;
- unsigned int function;
-};
-
-static int igt_device_get_pci_addr(int fd, struct igt_pci_addr *pci)
+int igt_device_get_pci_addr(int fd, struct igt_pci_addr *pci)
{
char path[IGT_DEV_PATH_LEN];
char *buf;
diff --git a/lib/igt_device.h b/lib/igt_device.h
index 278ba7a9..35eb4948 100644
--- a/lib/igt_device.h
+++ b/lib/igt_device.h
@@ -25,6 +25,13 @@
#ifndef __IGT_DEVICE_H__
#define __IGT_DEVICE_H__
+struct igt_pci_addr {
+ unsigned int domain;
+ unsigned int bus;
+ unsigned int device;
+ unsigned int function;
+};
+
int __igt_device_set_master(int fd);
void igt_device_set_master(int fd);
@@ -32,6 +39,7 @@ int __igt_device_drop_master(int fd);
void igt_device_drop_master(int fd);
int igt_device_get_card_index(int fd);
+int igt_device_get_pci_addr(int fd, struct igt_pci_addr *pci);
struct pci_device *igt_device_get_pci_device(int fd);
#endif /* __IGT_DEVICE_H__ */
--
2.20.1
More information about the igt-dev
mailing list