diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-03 14:52:11 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-03 16:15:22 +0100 |
commit | a0476ee6d0770156098aa633018addfc607c8a99 (patch) | |
tree | 43bb8494f90093d7ae7ef43246fe7949c3cfa84a /src/intel_device.c | |
parent | a47f8683fefc9caa4df914de59929ae99823ca37 (diff) |
intel: Allow opening the device only through platform information
Only fail to open the device based on the PCI address, if and only if we
do not have sufficient platform information to find the correct system
device.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_device.c')
-rw-r--r-- | src/intel_device.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/intel_device.c b/src/intel_device.c index af1221bf..91405fa2 100644 --- a/src/intel_device.c +++ b/src/intel_device.c @@ -183,6 +183,9 @@ static int __intel_open_device(const struct pci_device *pci, char **path) char id[20]; int ret; + if (pci == NULL) + return -1; + snprintf(id, sizeof(id), "pci:%04x:%02x:%02x.%d", pci->domain, pci->bus, pci->dev, pci->func); |