]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/obsd-device.c
libpci: ecam: Fix detect sequence when addresses are not specified
[pciutils.git] / lib / obsd-device.c
index dc68422abf1ef02385c0b25145509ee6a1feeed3..e2e7652bcd75b32418af6d23e8561c0fca410639 100644 (file)
@@ -3,7 +3,9 @@
  *
  *     Adapted from fbsd-device.c by Matthieu Herrb <matthieu.herrb@laas.fr>, 2006
  *
- *     Can be freely distributed and used under the terms of the GNU GPL.
+ *     Can be freely distributed and used under the terms of the GNU GPL v2+.
+ *
+ *     SPDX-License-Identifier: GPL-2.0-or-later
  */
 
 #include <fcntl.h>
@@ -65,7 +67,7 @@ obsd_read(struct pci_dev *d, int pos, byte *buf, int len)
   if (!(len == 1 || len == 2 || len == 4))
     return pci_generic_block_read(d, pos, buf, len);
 
-  if (pos >= 256)
+  if (d->domain || pos >= 256)
     return 0;
 
   pi.pi_sel.pc_bus = d->bus;
@@ -106,7 +108,7 @@ obsd_write(struct pci_dev *d, int pos, byte *buf, int len)
   if (!(len == 1 || len == 2 || len == 4))
     return pci_generic_block_write(d, pos, buf, len);
 
-  if (pos >= 256)
+  if (d->domain || pos >= 256)
     return 0;
 
   pi.pi_sel.pc_bus = d->bus;