Re: [PATCH] drm: remove pci domain local copy (02/07)

From: Jeff Garzik
Date: Sat Jul 22 2006 - 12:32:29 EST


Dave Airlie wrote:
Just call a function to retrieve the pci domain, this isn't exactly
hotpath code.

Signed-off-by: Dave Airlie <airlied@xxxxxxxx>
(cherry picked from 01852d755753bbfcd5434c55d4d7375580f8338f commit)
---
drivers/char/drm/drmP.h | 10 +++++++++-
drivers/char/drm/drm_ioctl.c | 4 ++--
drivers/char/drm/drm_irq.c | 2 +-
3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/char/drm/drmP.h b/drivers/char/drm/drmP.h
index 5c8f245..4dd28e1 100644
--- a/drivers/char/drm/drmP.h
+++ b/drivers/char/drm/drmP.h
@@ -711,7 +711,6 @@ typedef struct drm_device {
drm_agp_head_t *agp; /**< AGP data */
struct pci_dev *pdev; /**< PCI device structure */
- int pci_domain; /**< PCI bus domain number */
#ifdef __alpha__
struct pci_controller *hose;
#endif
@@ -733,6 +732,15 @@ static __inline__ int drm_core_check_fea

I would presume that hose goes away too?


+static inline int drm_get_pci_domain(struct drm_device *dev)
+{
+#ifdef __alpha__
+ return dev->hose->bus->number;
+#else
+ return 0;
+#endif
+}

Please use the always-present pci_domain_nr() rather than inventing a DRM-specific function that does the same thing.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/