staging: comedi: pcm3724: remove boardinfo
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 8 Oct 2012 17:44:55 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Oct 2012 18:51:31 +0000 (11:51 -0700)
This driver only supports a single "boardtype". Remove the unneeded
boardinfo struct and its use in the driver.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/pcm3724.c

index 4102547dc6a8ed60f84a2a49688e7698504846d5..cbb344a0f725c29cc340646bcf63beb5ecbad1fc 100644 (file)
@@ -62,14 +62,6 @@ Copy/pasted/hacked from pcm724.c
 #define CR_A_MODE(a)   ((a)<<5)
 #define CR_CW          0x80
 
-struct pcm3724_board {
-       const char *name;       /*  driver name */
-       int dio;                /*  num of DIO */
-       int numofports;         /*  num of 8255 subdevices */
-       unsigned int IRQbits;   /*  allowed interrupts */
-       unsigned int io_range;  /*  len of IO space */
-};
-
 /* used to track configured dios */
 struct priv_pcm3724 {
        int dio_1;
@@ -233,14 +225,15 @@ static int subdev_3724_insn_config(struct comedi_device *dev,
 static int pcm3724_attach(struct comedi_device *dev,
                          struct comedi_devconfig *it)
 {
-       const struct pcm3724_board *board = comedi_board(dev);
        struct comedi_subdevice *s;
        unsigned long iobase;
        unsigned int iorange;
-       int ret, i, n_subdevices;
+       int ret, i;
+
+       dev->board_name = dev->driver->driver_name;
 
        iobase = it->options[0];
-       iorange = board->io_range;
+       iorange = PCM3724_SIZE;
 
        ret = alloc_private(dev, sizeof(struct priv_pcm3724));
        if (ret < 0)
@@ -250,19 +243,16 @@ static int pcm3724_attach(struct comedi_device *dev,
        ((struct priv_pcm3724 *)(dev->private))->dio_2 = 0;
 
        printk(KERN_INFO "comedi%d: pcm3724: board=%s, 0x%03lx ", dev->minor,
-              board->name, iobase);
+              dev->board_name, iobase);
        if (!iobase || !request_region(iobase, iorange, "pcm3724")) {
                printk("I/O port conflict\n");
                return -EIO;
        }
 
        dev->iobase = iobase;
-       dev->board_name = board->name;
        printk(KERN_INFO "\n");
 
-       n_subdevices = board->numofports;
-
-       ret = comedi_alloc_subdevices(dev, n_subdevices);
+       ret = comedi_alloc_subdevices(dev, 2);
        if (ret)
                return ret;
 
@@ -277,7 +267,6 @@ static int pcm3724_attach(struct comedi_device *dev,
 
 static void pcm3724_detach(struct comedi_device *dev)
 {
-       const struct pcm3724_board *board = comedi_board(dev);
        struct comedi_subdevice *s;
        int i;
 
@@ -288,21 +277,14 @@ static void pcm3724_detach(struct comedi_device *dev)
                }
        }
        if (dev->iobase)
-               release_region(dev->iobase, board->io_range);
+               release_region(dev->iobase, PCM3724_SIZE);
 }
 
-static const struct pcm3724_board boardtypes[] = {
-       { "pcm3724", 48, 2, 0x00fc, PCM3724_SIZE, },
-};
-
 static struct comedi_driver pcm3724_driver = {
        .driver_name    = "pcm3724",
        .module         = THIS_MODULE,
        .attach         = pcm3724_attach,
        .detach         = pcm3724_detach,
-       .board_name     = &boardtypes[0].name,
-       .num_names      = ARRAY_SIZE(boardtypes),
-       .offset         = sizeof(struct pcm3724_board),
 };
 module_comedi_driver(pcm3724_driver);
 
This page took 0.025723 seconds and 5 git commands to generate.