#endif
};
-static inline struct hpdi_board *board(const struct comedi_device *dev)
-{
- return (struct hpdi_board *)dev->board_ptr;
-}
-
struct hpdi_private {
/* base addresses (ioremapped) */
void __iomem *plx9080_iobase;
unsigned long context_unused)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
+ const struct hpdi_board *thisboard;
struct hpdi_private *devpriv;
int i;
int retval;
- dev->board_ptr = hpdi_find_board(pcidev);
- if (!dev->board_ptr) {
+ thisboard = hpdi_find_board(pcidev);
+ if (!thisboard) {
dev_err(dev->class_dev, "gsc_hpdi: pci %s not supported\n",
pci_name(pcidev));
return -EINVAL;
}
+ dev->board_ptr = thisboard;
+ dev->board_name = thisboard->name;
devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
if (!devpriv)
dev->iobase = 1; /* the "detach" needs this */
pci_set_master(pcidev);
- /* Initialize dev->board_name */
- dev->board_name = board(dev)->name;
-
devpriv->plx9080_iobase =
ioremap(pci_resource_start(pcidev, PLX9080_BADDRINDEX),
pci_resource_len(pcidev, PLX9080_BADDRINDEX));