summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/pcl711.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-09-20 16:42:52 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-09-25 16:00:00 -0700
commit0fd8ebea1b6f251442801bb5cdf665a56f8d45b2 (patch)
treecf8d8334b0bf098281a500f214e38ed47bef4dff /drivers/staging/comedi/drivers/pcl711.c
parent54f0db981a7f6398ab688c5ac5359a12816c0a66 (diff)
staging: comedi: pcl711: remove 'is_pcl711b' from boardinfo
This member in the board info is used to indicate if the board is a PCL711B. This board uses bits in the mode register to select the IRQ used for interrupts. These bits do nothing on the other boards supported by this driver. Remove the 'is_pcl711b' variable from the boardinfo. Also, remove the 'mode' variable from the private data and just calculate the mode bits when needed. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/pcl711.c')
-rw-r--r--drivers/staging/comedi/drivers/pcl711.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/comedi/drivers/pcl711.c
index fd72a536f5e6..4b5da611c695 100644
--- a/drivers/staging/comedi/drivers/pcl711.c
+++ b/drivers/staging/comedi/drivers/pcl711.c
@@ -141,7 +141,6 @@ static const int i8253_osc_base = 500; /* 2 Mhz */
struct pcl711_board {
const char *name;
- unsigned int is_pcl711b:1;
int n_aichan;
int n_aochan;
int maxirq;
@@ -156,7 +155,6 @@ static const struct pcl711_board boardtypes[] = {
.ai_range_type = &range_bipolar5,
}, {
.name = "pcl711b",
- .is_pcl711b = 1,
.n_aichan = 8,
.n_aochan = 1,
.maxirq = 7,
@@ -182,7 +180,6 @@ struct pcl711_private {
int adchan;
int ntrig;
int aip[8];
- int mode;
unsigned int ao_readback[2];
unsigned int divisor1;
unsigned int divisor2;
@@ -190,10 +187,16 @@ struct pcl711_private {
static void pcl711_ai_set_mode(struct comedi_device *dev, unsigned int mode)
{
- struct pcl711_private *devpriv = dev->private;
-
+ /*
+ * The pcl711b board uses bits in the mode register to select the
+ * interrupt. The other boards supported by this driver all use
+ * jumpers on the board.
+ *
+ * Enables the interrupt when needed on the pcl711b board. These
+ * bits do nothing on the other boards.
+ */
if (mode == PCL711_MODE_EXT_IRQ || mode == PCL711_MODE_PACER_IRQ)
- mode |= devpriv->mode;
+ mode |= PCL711_MODE_IRQ(dev->irq);
outb(mode, dev->iobase + PCL711_MODE_REG);
}
@@ -504,16 +507,8 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (it->options[1] && it->options[1] <= board->maxirq) {
ret = request_irq(it->options[1], pcl711_interrupt, 0,
dev->board_name, dev);
- if (ret == 0) {
+ if (ret == 0)
dev->irq = it->options[1];
-
- /*
- * The PCL711b needs the irq number in the
- * mode register.
- */
- if (board->is_pcl711b)
- devpriv->mode = PCL711_MODE_IRQ(dev->irq);
- }
}
ret = comedi_alloc_subdevices(dev, 4);