|
@@ -403,7 +403,7 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
|
|
void intel_detect_pch(struct drm_device *dev)
|
|
void intel_detect_pch(struct drm_device *dev)
|
|
{
|
|
{
|
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
|
struct drm_i915_private *dev_priv = dev->dev_private;
|
|
- struct pci_dev *pch;
|
|
|
|
|
|
+ struct pci_dev *pch = NULL;
|
|
|
|
|
|
/* In all current cases, num_pipes is equivalent to the PCH_NOP setting
|
|
/* In all current cases, num_pipes is equivalent to the PCH_NOP setting
|
|
* (which really amounts to a PCH but no South Display).
|
|
* (which really amounts to a PCH but no South Display).
|
|
@@ -424,12 +424,9 @@ void intel_detect_pch(struct drm_device *dev)
|
|
* all the ISA bridge devices and check for the first match, instead
|
|
* all the ISA bridge devices and check for the first match, instead
|
|
* of only checking the first one.
|
|
* of only checking the first one.
|
|
*/
|
|
*/
|
|
- pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
|
|
|
|
- while (pch) {
|
|
|
|
- struct pci_dev *curr = pch;
|
|
|
|
|
|
+ while ((pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, pch))) {
|
|
if (pch->vendor == PCI_VENDOR_ID_INTEL) {
|
|
if (pch->vendor == PCI_VENDOR_ID_INTEL) {
|
|
- unsigned short id;
|
|
|
|
- id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
|
|
|
|
|
|
+ unsigned short id = pch->device & INTEL_PCH_DEVICE_ID_MASK;
|
|
dev_priv->pch_id = id;
|
|
dev_priv->pch_id = id;
|
|
|
|
|
|
if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) {
|
|
if (id == INTEL_PCH_IBX_DEVICE_ID_TYPE) {
|
|
@@ -461,18 +458,16 @@ void intel_detect_pch(struct drm_device *dev)
|
|
DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
|
|
DRM_DEBUG_KMS("Found LynxPoint LP PCH\n");
|
|
WARN_ON(!IS_HASWELL(dev));
|
|
WARN_ON(!IS_HASWELL(dev));
|
|
WARN_ON(!IS_ULT(dev));
|
|
WARN_ON(!IS_ULT(dev));
|
|
- } else {
|
|
|
|
- goto check_next;
|
|
|
|
- }
|
|
|
|
- pci_dev_put(pch);
|
|
|
|
|
|
+ } else
|
|
|
|
+ continue;
|
|
|
|
+
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-check_next:
|
|
|
|
- pch = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, curr);
|
|
|
|
- pci_dev_put(curr);
|
|
|
|
}
|
|
}
|
|
if (!pch)
|
|
if (!pch)
|
|
- DRM_DEBUG_KMS("No PCH found?\n");
|
|
|
|
|
|
+ DRM_DEBUG_KMS("No PCH found.\n");
|
|
|
|
+
|
|
|
|
+ pci_dev_put(pch);
|
|
}
|
|
}
|
|
|
|
|
|
bool i915_semaphore_is_enabled(struct drm_device *dev)
|
|
bool i915_semaphore_is_enabled(struct drm_device *dev)
|