staging: comedi: amplc_dio200: support memory-mapped I/O
The boards currently supported by this module all use port I/O. Support
memory-mapped I/O as well for future PCI/PCIe cards.
Define `struct dio200_region` to hold the type of register access and
either the port I/O base address or an ioremapped MMIO address. Add a
member `io` to the comedi device private data (`struct dio200_private`)
to hold this. Use this instead of `dev->iobase`. Memory-mapped
registers are mapped in `dio200_pci_attach()` and unmapped in
`dio200_detach()`.
`dio200_detach()` now uses the private data pointer `devpriv` set to
`dev->private` but can return early if it is `NULL` because no clean-up
needs to be done in that case.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>