diff options
Diffstat (limited to 'drivers/char/drm/drm_ioctl.c')
-rw-r--r-- | drivers/char/drm/drm_ioctl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c index 31dfe83141ea..9f20c2b5a366 100644 --- a/drivers/char/drm/drm_ioctl.c +++ b/drivers/char/drm/drm_ioctl.c | |||
@@ -128,8 +128,9 @@ int drm_setunique(struct inode *inode, struct file *filp, | |||
128 | bus &= 0xff; | 128 | bus &= 0xff; |
129 | 129 | ||
130 | if ((domain != dev->pci_domain) || | 130 | if ((domain != dev->pci_domain) || |
131 | (bus != dev->pci_bus) || | 131 | (bus != dev->pdev->bus->number) || |
132 | (slot != dev->pci_slot) || (func != dev->pci_func)) | 132 | (slot != PCI_SLOT(dev->pdev->devfn)) || |
133 | (func != PCI_FUNC(dev->pdev->devfn))) | ||
133 | return -EINVAL; | 134 | return -EINVAL; |
134 | 135 | ||
135 | return 0; | 136 | return 0; |
@@ -148,7 +149,9 @@ static int drm_set_busid(drm_device_t * dev) | |||
148 | return ENOMEM; | 149 | return ENOMEM; |
149 | 150 | ||
150 | len = snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d", | 151 | len = snprintf(dev->unique, dev->unique_len, "pci:%04x:%02x:%02x.%d", |
151 | dev->pci_domain, dev->pci_bus, dev->pci_slot, dev->pci_func); | 152 | dev->pci_domain, dev->pdev->bus->number, |
153 | PCI_SLOT(dev->pdev->devfn), | ||
154 | PCI_FUNC(dev->pdev->devfn)); | ||
152 | 155 | ||
153 | if (len > dev->unique_len) | 156 | if (len > dev->unique_len) |
154 | DRM_ERROR("Unique buffer overflowed\n"); | 157 | DRM_ERROR("Unique buffer overflowed\n"); |