diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-08-12 20:17:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-16 21:23:25 +0200 |
commit | c3f6aa33ed102cc36c3e2308c81f10fec62439f9 (patch) | |
tree | 8a0fc282a9d4fa4c385277f473d72204e5bbfcc9 | |
parent | staging: comedi: amplc_dio200.h: rename 'has_enhancements' in boardinfo (diff) | |
download | linux-c3f6aa33ed102cc36c3e2308c81f10fec62439f9.tar.xz linux-c3f6aa33ed102cc36c3e2308c81f10fec62439f9.zip |
staging: comedi: amplc_dio200.h: remove boardinfo 'mainshift'
This member of the boardinfo is only set for the PCIE boards. Use the
'is_pcie' flag to determine if the offset needs to be shifted when
reading/writing the registers.
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>
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_dio200.h | 1 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_dio200_common.c | 12 | ||||
-rw-r--r-- | drivers/staging/comedi/drivers/amplc_dio200_pci.c | 3 |
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_dio200.h b/drivers/staging/comedi/drivers/amplc_dio200.h index 306a9d68b2f6..d87539c34283 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200.h +++ b/drivers/staging/comedi/drivers/amplc_dio200.h @@ -34,7 +34,6 @@ enum dio200_sdtype { sd_none, sd_intr, sd_8255, sd_8254, sd_timer }; struct dio200_board { const char *name; unsigned char mainbar; - unsigned char mainshift; unsigned short n_subdevs; /* number of subdevices */ unsigned char sdtype[DIO200_MAX_SUBDEVS]; /* enum dio200_sdtype */ unsigned char sdinfo[DIO200_MAX_SUBDEVS]; /* depends on sdtype */ diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c index 2b33df716cc6..5835e27c1842 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200_common.c +++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c @@ -137,7 +137,8 @@ static unsigned char dio200_read8(struct comedi_device *dev, { const struct dio200_board *board = comedi_board(dev); - offset <<= board->mainshift; + if (board->is_pcie) + offset <<= 3; if (dev->mmio) return readb(dev->mmio + offset); @@ -149,7 +150,8 @@ static void dio200_write8(struct comedi_device *dev, { const struct dio200_board *board = comedi_board(dev); - offset <<= board->mainshift; + if (board->is_pcie) + offset <<= 3; if (dev->mmio) writeb(val, dev->mmio + offset); @@ -162,7 +164,8 @@ static unsigned int dio200_read32(struct comedi_device *dev, { const struct dio200_board *board = comedi_board(dev); - offset <<= board->mainshift; + if (board->is_pcie) + offset <<= 3; if (dev->mmio) return readl(dev->mmio + offset); @@ -174,7 +177,8 @@ static void dio200_write32(struct comedi_device *dev, { const struct dio200_board *board = comedi_board(dev); - offset <<= board->mainshift; + if (board->is_pcie) + offset <<= 3; if (dev->mmio) writel(val, dev->mmio + offset); diff --git a/drivers/staging/comedi/drivers/amplc_dio200_pci.c b/drivers/staging/comedi/drivers/amplc_dio200_pci.c index 4030c702455f..2dfdcaf3612c 100644 --- a/drivers/staging/comedi/drivers/amplc_dio200_pci.c +++ b/drivers/staging/comedi/drivers/amplc_dio200_pci.c @@ -265,7 +265,6 @@ static const struct dio200_board dio200_pci_boards[] = { [pcie215_model] = { .name = "pcie215", .mainbar = 1, - .mainshift = 3, .n_subdevs = 8, .sdtype = { sd_8255, sd_none, sd_8255, sd_none, @@ -281,7 +280,6 @@ static const struct dio200_board dio200_pci_boards[] = { [pcie236_model] = { .name = "pcie236", .mainbar = 1, - .mainshift = 3, .n_subdevs = 8, .sdtype = { sd_8255, sd_none, sd_none, sd_none, @@ -297,7 +295,6 @@ static const struct dio200_board dio200_pci_boards[] = { [pcie296_model] = { .name = "pcie296", .mainbar = 1, - .mainshift = 3, .n_subdevs = 8, .sdtype = { sd_8255, sd_8255, sd_8255, sd_8255, |