Commit c3f6aa33 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c1b0cccc
......@@ -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 */
......
......@@ -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);
......
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment