summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-08-06 09:39:01 +1000
committerDave Airlie <airlied@redhat.com>2009-08-06 09:41:09 +1000
commit57cf6f1f428ab73fb2a88c39c694e7d14c2c96c6 (patch)
treec9298f3e6ade499b796764518005e0586a59dfb1 /src
parent7b7999a302c70f1ad9a5c8fc7517e24ab95c3a95 (diff)
downloadlibpciaccess-57cf6f1f428ab73fb2a88c39c694e7d14c2c96c6.tar.gz
libpciaccess-57cf6f1f428ab73fb2a88c39c694e7d14c2c96c6.tar.bz2
libpciaccess-57cf6f1f428ab73fb2a88c39c694e7d14c2c96c6.zip
pciaccess: make linux rom reading fallback optional
On kernels which have ROM files, the boot VGA rom file will contain the 0xc0000 file anyways. If another card is missing a rom file there is no need for this. This is fallback is disabled by default, on the premise that distro shipping this new a pciaccess will be running on kernels with working rom support which is been upstream for a long time
Diffstat (limited to 'src')
-rw-r--r--src/linux_sysfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 65e1cf6..02fbd13 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -327,10 +327,15 @@ pci_device_linux_sysfs_read_rom( struct pci_device * dev, void * buffer )
fd = open( name, O_RDWR );
if ( fd == -1 ) {
+#ifdef LINUX_ROM
/* If reading the ROM using sysfs fails, fall back to the old
* /dev/mem based interface.
+ * disable this for newer kernels using configure
*/
return pci_device_linux_devmem_read_rom(dev, buffer);
+#else
+ return errno;
+#endif
}