Unify usage of iopl-like code by introducing get_io_perms()

Factor out portable iopl()-style code into a global function which all
programmers can use, add missing close() call.

Corresponding to flashrom svn r511.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
3 files changed