diff options
author | Dave <airlied@linux.ie> | 2006-07-17 14:01:01 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2006-09-21 15:32:30 -0400 |
commit | 242ef0e1e7e5bb7e80c3620c1aa55168819d6fb8 (patch) | |
tree | 759bc571c641b90271c306ee37c6dfff7daffca3 /drivers/char/drm | |
parent | 3d77461ecd7fb92bb888f69478e3518b3c947ce3 (diff) |
drm: remove local copies of pci bus/slot/func
The drm keeps a local copy of these for little use.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm')
-rw-r--r-- | drivers/char/drm/drmP.h | 3 | ||||
-rw-r--r-- | drivers/char/drm/drm_ioctl.c | 9 | ||||
-rw-r--r-- | drivers/char/drm/drm_irq.c | 4 | ||||
-rw-r--r-- | drivers/char/drm/drm_stub.c | 3 |
4 files changed, 8 insertions, 11 deletions
diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h index cccfdb720e96..9838e8ce6ff2 100644 --- a/drivers/char/drm/drmP.h +++ b/drivers/char/drm/drmP.h | |||
@@ -700,9 +700,6 @@ typedef struct drm_device { | |||
700 | 700 | ||
701 | struct pci_dev *pdev; /**< PCI device structure */ | 701 | struct pci_dev *pdev; /**< PCI device structure */ |
702 | int pci_domain; /**< PCI bus domain number */ | 702 | int pci_domain; /**< PCI bus domain number */ |
703 | int pci_bus; /**< PCI bus number */ | ||
704 | int pci_slot; /**< PCI slot number */ | ||
705 | int pci_func; /**< PCI function number */ | ||
706 | #ifdef __alpha__ | 703 | #ifdef __alpha__ |
707 | struct pci_controller *hose; | 704 | struct pci_controller *hose; |
708 | #endif | 705 | #endif |
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"); |
diff --git a/drivers/char/drm/drm_irq.c b/drivers/char/drm/drm_irq.c index 8e484d23e12b..41c7020c93ef 100644 --- a/drivers/char/drm/drm_irq.c +++ b/drivers/char/drm/drm_irq.c | |||
@@ -65,8 +65,8 @@ int drm_irq_by_busid(struct inode *inode, struct file *filp, | |||
65 | return -EFAULT; | 65 | return -EFAULT; |
66 | 66 | ||
67 | if ((p.busnum >> 8) != dev->pci_domain || | 67 | if ((p.busnum >> 8) != dev->pci_domain || |
68 | (p.busnum & 0xff) != dev->pci_bus || | 68 | (p.busnum & 0xff) != dev->pdev->bus->number || |
69 | p.devnum != dev->pci_slot || p.funcnum != dev->pci_func) | 69 | p.devnum != PCI_SLOT(dev->pdev->devfn) || p.funcnum != PCI_FUNC(dev->pdev->devfn)) |
70 | return -EINVAL; | 70 | return -EINVAL; |
71 | 71 | ||
72 | p.irq = dev->irq; | 72 | p.irq = dev->irq; |
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c index 9a842a36bb27..96449d538e15 100644 --- a/drivers/char/drm/drm_stub.c +++ b/drivers/char/drm/drm_stub.c | |||
@@ -72,9 +72,6 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev, | |||
72 | #else | 72 | #else |
73 | dev->pci_domain = 0; | 73 | dev->pci_domain = 0; |
74 | #endif | 74 | #endif |
75 | dev->pci_bus = pdev->bus->number; | ||
76 | dev->pci_slot = PCI_SLOT(pdev->devfn); | ||
77 | dev->pci_func = PCI_FUNC(pdev->devfn); | ||
78 | dev->irq = pdev->irq; | 75 | dev->irq = pdev->irq; |
79 | 76 | ||
80 | dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS); | 77 | dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS); |