From a0476ee6d0770156098aa633018addfc607c8a99 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 3 Oct 2013 14:52:11 +0100 Subject: [PATCH] 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 --- src/intel_device.c | 3 +++ src/intel_module.c | 3 --- 2 files changed, 3 insertions(+), 3 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); diff --git a/src/intel_module.c b/src/intel_module.c index d8cf9de6..72c028e3 100644 --- a/src/intel_module.c +++ b/src/intel_module.c @@ -546,9 +546,6 @@ intel_platform_probe(DriverPtr driver, { unsigned scrn_flags = 0; - if (!dev->pdev) - return FALSE; - if (intel_open_device(entity_num, dev->pdev, dev) == -1) return FALSE;