summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/amplc_dio200_common.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-02-23 14:57:56 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-01 18:51:52 -0800
commit3a4959a3a0bd50bbbc5101abec6420d56582ec98 (patch)
treed668853c1dec6665886ce732ffa72fb1e9b11c00 /drivers/staging/comedi/drivers/amplc_dio200_common.c
parent5f907df0302b1d723887926ec7dba39bf1d31da5 (diff)
staging: comedi: amplc_dio200_common: remove 'clk_sce_ofs' from struct dio200_subdev_8254
This member is only used one place in the driver. Remove it and calculate the register offset when needed. 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>
Diffstat (limited to 'drivers/staging/comedi/drivers/amplc_dio200_common.c')
-rw-r--r--drivers/staging/comedi/drivers/amplc_dio200_common.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index 709fe1a1ee0b..1786ea2c61a3 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -99,7 +99,6 @@ static const unsigned int ts_clock_period[TS_CONFIG_MAX_CLK_SRC + 1] = {
struct dio200_subdev_8254 {
unsigned int ofs; /* Counter base offset */
- unsigned int clk_sce_ofs; /* CLK_SCE base address */
unsigned int gat_sce_ofs; /* GAT_SCE base address */
int which; /* Bit 5 of CLK_SCE or GAT_SCE */
unsigned int clock_src[3]; /* Current clock sources */
@@ -625,7 +624,7 @@ static int dio200_subdev_8254_set_clock_src(struct comedi_device *dev,
subpriv->clock_src[counter_number] = clock_src;
byte = clk_sce(subpriv->which, counter_number, clock_src);
- dio200_write8(dev, subpriv->clk_sce_ofs, byte);
+ dio200_write8(dev, DIO200_CLK_SCE(subpriv->ofs >> 3), byte);
return 0;
}
@@ -729,7 +728,6 @@ static int dio200_subdev_8254_init(struct comedi_device *dev,
if (board->has_clk_gat_sce) {
/* Derive CLK_SCE and GAT_SCE register offsets from
* 8254 offset. */
- subpriv->clk_sce_ofs = DIO200_CLK_SCE(offset >> 3);
subpriv->gat_sce_ofs = DIO200_GAT_SCE(offset >> 3);
subpriv->which = (offset >> 2) & 1;
}