},
};
-struct pci_8255_private {
- void __iomem *mmio_base;
-};
-
/* ripped from mite.h and mite_setup2() to avoid mite dependancy */
#define MITE_IODWBSR 0xc0 /* IO Device Window Base Size Register */
#define WENAB (1 << 7) /* window enable */
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct pci_8255_boardinfo *board = NULL;
- struct pci_8255_private *devpriv;
struct comedi_subdevice *s;
bool is_mmio;
int ret;
dev->board_ptr = board;
dev->board_name = board->name;
- devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
- if (!devpriv)
- return -ENOMEM;
-
ret = comedi_pci_enable(dev);
if (ret)
return ret;
is_mmio = (pci_resource_flags(pcidev, board->dio_badr) &
IORESOURCE_MEM) != 0;
if (is_mmio) {
- devpriv->mmio_base = pci_ioremap_bar(pcidev, board->dio_badr);
- if (!devpriv->mmio_base)
+ dev->mmio = pci_ioremap_bar(pcidev, board->dio_badr);
+ if (!dev->mmio)
return -ENOMEM;
} else {
dev->iobase = pci_resource_start(pcidev, board->dio_badr);
s = &dev->subdevices[i];
if (is_mmio) {
- iobase = (unsigned long)(devpriv->mmio_base + (i * 4));
+ iobase = (unsigned long)(dev->mmio + (i * 4));
ret = subdev_8255_init(dev, s, pci_8255_mmio, iobase);
} else {
iobase = dev->iobase + (i * 4);
static void pci_8255_detach(struct comedi_device *dev)
{
- struct pci_8255_private *devpriv = dev->private;
-
- if (devpriv && devpriv->mmio_base)
- iounmap(devpriv->mmio_base);
+ if (dev->mmio)
+ iounmap(dev->mmio);
comedi_pci_disable(dev);
}