staging: comedi: amplc_dio200.h: remove boardinfo 'mainshift'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 12 Aug 2014 18:17:21 +0000 (11:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 16 Aug 2014 19:23:25 +0000 (12:23 -0700)
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>
drivers/staging/comedi/drivers/amplc_dio200.h
drivers/staging/comedi/drivers/amplc_dio200_common.c
drivers/staging/comedi/drivers/amplc_dio200_pci.c

index 306a9d6..d87539c 100644 (file)
@@ -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 */
index 2b33df7..5835e27 100644 (file)
@@ -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);
index 4030c70..2dfdcaf 100644 (file)
@@ -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,