From caacc6c523c6af55a29c64839799916a84cd618b Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 28 May 2012 10:40:40 +0100 Subject: [PATCH] amplc_dio200: Eliminate 'has_clk_gat_sce' from 'dio200_subdev_8254'. Remove 'has_clk_gat_sce' flag from 'struct dio200_subdev_8254'. Just use the corresponding flag from the card layout structure instead. Signed-off-by: Ian Abbott --- comedi/drivers/amplc_dio200.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/comedi/drivers/amplc_dio200.c b/comedi/drivers/amplc_dio200.c index 139f01d4..a17d4a4e 100644 --- a/comedi/drivers/amplc_dio200.c +++ b/comedi/drivers/amplc_dio200.c @@ -451,7 +451,6 @@ typedef struct { unsigned long clk_sce_iobase; /* CLK_SCE base address */ unsigned long gat_sce_iobase; /* GAT_SCE base address */ int which; /* Bit 5 of CLK_SCE or GAT_SCE */ - int has_clk_gat_sce; unsigned clock_src[3]; /* Current clock sources */ unsigned gate_src[3]; /* Current gate sources */ spinlock_t spinlock; @@ -1082,7 +1081,7 @@ dio200_subdev_8254_set_gate_src(comedi_device * dev, comedi_subdevice *s, dio200_subdev_8254 *subpriv = s->private; unsigned char byte; - if (!subpriv->has_clk_gat_sce) + if (!thislayout->has_clk_gat_sce) return -1; if (counter_number > 2) return -1; @@ -1105,7 +1104,7 @@ dio200_subdev_8254_get_gate_src(comedi_device * dev, comedi_subdevice *s, { dio200_subdev_8254 *subpriv = s->private; - if (!subpriv->has_clk_gat_sce) + if (!thislayout->has_clk_gat_sce) return -1; if (counter_number > 2) return -1; @@ -1123,7 +1122,7 @@ dio200_subdev_8254_set_clock_src(comedi_device * dev, comedi_subdevice *s, dio200_subdev_8254 *subpriv = s->private; unsigned char byte; - if (!subpriv->has_clk_gat_sce) + if (!thislayout->has_clk_gat_sce) return -1; if (counter_number > 2) return -1; @@ -1147,7 +1146,7 @@ dio200_subdev_8254_get_clock_src(comedi_device * dev, comedi_subdevice *s, dio200_subdev_8254 *subpriv = s->private; unsigned clock_src; - if (!subpriv->has_clk_gat_sce) + if (!thislayout->has_clk_gat_sce) return -1; if (counter_number > 2) return -1; @@ -1221,7 +1220,7 @@ dio200_subdev_8254_config(comedi_device * dev, comedi_subdevice * s, */ static int dio200_subdev_8254_init(comedi_device * dev, comedi_subdevice * s, - unsigned long iobase, unsigned offset, int has_clk_gat_sce) + unsigned long iobase, unsigned offset) { dio200_subdev_8254 *subpriv; unsigned int chan; @@ -1244,8 +1243,7 @@ dio200_subdev_8254_init(comedi_device * dev, comedi_subdevice * s, spin_lock_init(&subpriv->spinlock); subpriv->iobase = offset + iobase; - subpriv->has_clk_gat_sce = has_clk_gat_sce; - if (has_clk_gat_sce) { + if (thislayout->has_clk_gat_sce) { /* Derive CLK_SCE and GAT_SCE register offsets from * 8254 offset. */ subpriv->clk_sce_iobase = @@ -1259,7 +1257,7 @@ dio200_subdev_8254_init(comedi_device * dev, comedi_subdevice * s, for (chan = 0; chan < 3; chan++) { i8254_set_mode(subpriv->iobase, 0, chan, I8254_MODE0 | I8254_BINARY); - if (subpriv->has_clk_gat_sce) { + if (thislayout->has_clk_gat_sce) { /* Gate source 0 is VCC (logic 1). */ dio200_subdev_8254_set_gate_src(dev, s, chan, 0); /* Clock source 0 is the dedicated clock input. */ @@ -1376,7 +1374,7 @@ static int dio200_attach(comedi_device * dev, comedi_devconfig * it) case sd_8254: /* counter subdevice (8254) */ ret = dio200_subdev_8254_init(dev, s, iobase, - layout->sdinfo[n], layout->has_clk_gat_sce); + layout->sdinfo[n]); if (ret < 0) { return ret; } -- 2.26.2