Releasing IO permissions was done by hand everywhere
Use a proper abstraction. Kill unneeded #include statements.
Corresponding to flashrom svn r672.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
diff --git a/nic3com.c b/nic3com.c
index 81b4f9e..bdf7db2 100644
--- a/nic3com.c
+++ b/nic3com.c
@@ -20,10 +20,7 @@
#include <stdlib.h>
#include <string.h>
-#include <fcntl.h>
#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
#include "flash.h"
#define BIOS_ROM_ADDR 0x04
@@ -99,9 +96,7 @@
free(pcidev_bdf);
pci_cleanup(pacc);
-#if defined(__FreeBSD__) || defined(__DragonFly__)
- close(io_fd);
-#endif
+ release_io_perms();
return 0;
}