X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fi386-io-linux.h;h=672897fab23ddcdded2d850c1c06494c64e2b361;hb=2f4211843f4f68c2a8a92155c24ac72d5799379b;hp=ee119d25094608eb1ecc43be4f4c37951671e2f7;hpb=68245cfdf612741cb0916434a25ef86c408821c1;p=pciutils.git diff --git a/lib/i386-io-linux.h b/lib/i386-io-linux.h index ee119d2..672897f 100644 --- a/lib/i386-io-linux.h +++ b/lib/i386-io-linux.h @@ -1,7 +1,7 @@ /* * The PCI Library -- Access to i386 I/O ports on Linux * - * Copyright (c) 1997--2003 Martin Mares + * Copyright (c) 1997--2006 Martin Mares * * Can be freely distributed and used under the terms of the GNU GPL. */ @@ -12,20 +12,15 @@ #include #endif -static int intel_iopl_set = -1; - static int -intel_setup_io(void) +intel_setup_io(struct pci_access *a UNUSED) { - if (intel_iopl_set < 0) - intel_iopl_set = (iopl(3) < 0) ? 0 : 1; - return intel_iopl_set; + return (iopl(3) < 0) ? 0 : 1; } -static inline void -intel_cleanup_io(void) +static inline int +intel_cleanup_io(struct pci_access *a UNUSED) { - if (intel_iopl_set > 0) - iopl(3); - intel_iopl_set = -1; + iopl(3); + return -1; }