From f485c553c23c67fd060fdea82f57128fd4a1749e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 9 May 2008 15:23:49 -0700 Subject: Print error message when pci_device_map_range fails --- src/nv_setup.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/nv_setup.c b/src/nv_setup.c index b057da1..bea0050 100644 --- a/src/nv_setup.c +++ b/src/nv_setup.c @@ -341,7 +341,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. */ @@ -371,8 +374,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); -- cgit v1.2.3