mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 13:59:45 -04:00
staging: comedi: amplc_dio200_common: remove 'which' from struct dio200_subdev_8254
This member is only used in the "set gate" and "set clock" helper functions. Remove it and calculate the value 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5814504f4d
commit
fdb7c3ece2
@@ -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 */
|
||||
int which; /* Bit 5 of CLK_SCE or GAT_SCE */
|
||||
unsigned int clock_src[3]; /* Current clock sources */
|
||||
unsigned int gate_src[3]; /* Current gate sources */
|
||||
spinlock_t spinlock;
|
||||
@@ -584,7 +583,7 @@ static int dio200_subdev_8254_set_gate_src(struct comedi_device *dev,
|
||||
return -1;
|
||||
|
||||
subpriv->gate_src[counter_number] = gate_src;
|
||||
byte = gat_sce(subpriv->which, counter_number, gate_src);
|
||||
byte = gat_sce((subpriv->ofs >> 2) & 1, counter_number, gate_src);
|
||||
dio200_write8(dev, DIO200_GAT_SCE(subpriv->ofs >> 3), byte);
|
||||
|
||||
return 0;
|
||||
@@ -622,7 +621,7 @@ static int dio200_subdev_8254_set_clock_src(struct comedi_device *dev,
|
||||
return -1;
|
||||
|
||||
subpriv->clock_src[counter_number] = clock_src;
|
||||
byte = clk_sce(subpriv->which, counter_number, clock_src);
|
||||
byte = clk_sce((subpriv->ofs >> 2) & 1, counter_number, clock_src);
|
||||
dio200_write8(dev, DIO200_CLK_SCE(subpriv->ofs >> 3), byte);
|
||||
|
||||
return 0;
|
||||
@@ -724,8 +723,6 @@ static int dio200_subdev_8254_init(struct comedi_device *dev,
|
||||
|
||||
spin_lock_init(&subpriv->spinlock);
|
||||
subpriv->ofs = offset;
|
||||
if (board->has_clk_gat_sce)
|
||||
subpriv->which = (offset >> 2) & 1;
|
||||
|
||||
/* Initialize channels. */
|
||||
for (chan = 0; chan < 3; chan++) {
|
||||
|
||||
Reference in New Issue
Block a user