>From 65948262645b720e7b4988a6d39fe2dbde8ea1cf Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 9 May 2008 15:23:49 -0700 Subject: [PATCH] Print error message when pci_device_map_range fails --- src/nv_setup.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/nv_setup.c b/src/nv_setup.c index 72a7844..f543935 100644 --- a/src/nv_setup.c +++ b/src/nv_setup.c @@ -357,7 +357,10 @@ NVCommonSetup(ScrnInfoPtr pScrn) int FlatPanel = -1; /* really means the CRTC is slaved */ Bool Television = FALSE; void *tmp; - +#if XSERVER_LIBPCIACCESS + int err; +#endif + /* * Override VGA I/O routines. */ @@ -387,8 +390,12 @@ NVCommonSetup(ScrnInfoPtr pScrn) pVga->MMIOOffset = 0; #if XSERVER_LIBPCIACCESS - pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000, - PCI_DEV_MAP_FLAG_WRITABLE, &tmp); + err = pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000, + PCI_DEV_MAP_FLAG_WRITABLE, &tmp); + if (err != 0) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "pci_device_map_range failed: %s\n", strerror(err)); + } #else tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, pNv->PciTag, pNv->IOAddress, 0x01000000); -- 1.4.1