virtio: Use PCI revision field to indicate virtio PCI ABI version
[deliverable/linux.git] / drivers / virtio / virtio_pci.c
index 192687e3a56ad3ff5bde882d68ecce525a4dc273..26f787ddd5ff58b81165d8d443bb3bda23db2586 100644 (file)
@@ -311,6 +311,12 @@ static int __devinit virtio_pci_probe(struct pci_dev *pci_dev,
        if (pci_dev->device < 0x1000 || pci_dev->device > 0x103f)
                return -ENODEV;
 
+       if (pci_dev->revision != VIRTIO_PCI_ABI_VERSION) {
+               printk(KERN_ERR "virtio_pci: expected ABI version %d, got %d\n",
+                      VIRTIO_PCI_ABI_VERSION, pci_dev->revision);
+               return -ENODEV;
+       }
+
        /* allocate our structure and fill it out */
        vp_dev = kzalloc(sizeof(struct virtio_pci_device), GFP_KERNEL);
        if (vp_dev == NULL)
This page took 0.035639 seconds and 5 git commands to generate.