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

staging: comedi: s626: remove 'get_load_trig' callback from encoder private data

There are two functions used for the 'get_load_trig' callback. One is used for
the channel 0-2 encoders and the other for the channel 3-5 encoders.

Refactor the two callbacks into a single s626_get_load_trig() function and use
the encoder channel number to handle the differences.

Remove the then unnecessary 'get_enable' member from the encoder private data.

The 'get_load_trig' callbacks were not being used by the driver. For now block
the s626_get_load_trig() function with '#ifdef unused' to prevent a compiler
warning.
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 7f03b749
......@@ -110,9 +110,6 @@ struct s626_enc_info {
/* Return interrupt source. */
uint16_t (*get_int_src)(struct comedi_device *dev,
const struct s626_enc_info *k);
/* Return preload trigger source. */
uint16_t (*get_load_trig)(struct comedi_device *dev,
const struct s626_enc_info *k);
/* Return standardized operating mode. */
uint16_t (*get_mode)(struct comedi_device *dev,
const struct s626_enc_info *k);
......@@ -1125,19 +1122,18 @@ static void s626_set_load_trig(struct comedi_device *dev,
s626_debi_replace(dev, reg, ~mask, set);
}
static uint16_t s626_get_load_trig_a(struct comedi_device *dev,
const struct s626_enc_info *k)
{
return S626_GET_CRA_LOADSRC_A(s626_debi_read(dev,
S626_LP_CRA(k->chan)));
}
static uint16_t s626_get_load_trig_b(struct comedi_device *dev,
const struct s626_enc_info *k)
#ifdef unused
static uint16_t s626_get_load_trig(struct comedi_device *dev,
const struct s626_enc_info *k)
{
return S626_GET_CRB_LOADSRC_B(s626_debi_read(dev,
S626_LP_CRB(k->chan)));
if (k->chan < 3)
return S626_GET_CRA_LOADSRC_A(s626_debi_read(dev,
S626_LP_CRA(k->chan)));
else
return S626_GET_CRB_LOADSRC_B(s626_debi_read(dev,
S626_LP_CRB(k->chan)));
}
#endif
/*
* Return/set counter interrupt source and clear any captured
......@@ -1318,7 +1314,6 @@ static const struct s626_enc_info s626_enc_chan_info[] = {
{
.chan = 0,
.get_int_src = s626_get_int_src_a,
.get_load_trig = s626_get_load_trig_a,
.get_mode = s626_get_mode_a,
.pulse_index = s626_pulse_index_a,
.set_int_src = s626_set_int_src_a,
......@@ -1328,7 +1323,6 @@ static const struct s626_enc_info s626_enc_chan_info[] = {
}, {
.chan = 1,
.get_int_src = s626_get_int_src_a,
.get_load_trig = s626_get_load_trig_a,
.get_mode = s626_get_mode_a,
.pulse_index = s626_pulse_index_a,
.set_int_src = s626_set_int_src_a,
......@@ -1338,7 +1332,6 @@ static const struct s626_enc_info s626_enc_chan_info[] = {
}, {
.chan = 2,
.get_int_src = s626_get_int_src_a,
.get_load_trig = s626_get_load_trig_a,
.get_mode = s626_get_mode_a,
.pulse_index = s626_pulse_index_a,
.set_int_src = s626_set_int_src_a,
......@@ -1348,7 +1341,6 @@ static const struct s626_enc_info s626_enc_chan_info[] = {
}, {
.chan = 3,
.get_int_src = s626_get_int_src_b,
.get_load_trig = s626_get_load_trig_b,
.get_mode = s626_get_mode_b,
.pulse_index = s626_pulse_index_b,
.set_int_src = s626_set_int_src_b,
......@@ -1358,7 +1350,6 @@ static const struct s626_enc_info s626_enc_chan_info[] = {
}, {
.chan = 4,
.get_int_src = s626_get_int_src_b,
.get_load_trig = s626_get_load_trig_b,
.get_mode = s626_get_mode_b,
.pulse_index = s626_pulse_index_b,
.set_int_src = s626_set_int_src_b,
......@@ -1368,7 +1359,6 @@ static const struct s626_enc_info s626_enc_chan_info[] = {
}, {
.chan = 5,
.get_int_src = s626_get_int_src_b,
.get_load_trig = s626_get_load_trig_b,
.get_mode = s626_get_mode_b,
.pulse_index = s626_pulse_index_b,
.set_int_src = s626_set_int_src_b,
......
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