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>
This commit is contained in:
H Hartley Sweeten 2014-08-12 11:17:21 -07:00 committed by Greg Kroah-Hartman
parent c1b0cccc59
commit c3f6aa33ed
3 changed files with 8 additions and 8 deletions

View 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 */

View 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);

View 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,