Skip to content

Commit

Permalink
staging:iio:adc:ad799x address and scan_index always match so stop us…
Browse files Browse the repository at this point in the history
…ing address

Saves on setting the value of address for the simple situation seen in this
device. They are already used interchangably to get data from the buffer.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Oct 3, 2011
1 parent b79c9a3 commit 58dffae
Showing 1 changed file with 1 addition and 39 deletions.
40 changes: 1 addition & 39 deletions drivers/staging/iio/adc/ad799x_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static int ad799x_read_raw(struct iio_dev *dev_info,
ret = ad799x_single_channel_from_ring(dev_info,
chan->scan_index);
else
ret = ad799x_scan_direct(st, chan->address);
ret = ad799x_scan_direct(st, chan->scan_index);
mutex_unlock(&dev_info->mlock);

if (ret < 0)
Expand Down Expand Up @@ -454,31 +454,27 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0),
},
[1] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0),
},
[2] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
.address = 2,
.scan_index = 2,
.scan_type = IIO_ST('u', 12, 16, 0),
},
[3] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 3,
.address = 3,
.scan_index = 3,
.scan_type = IIO_ST('u', 12, 16, 0),
},
Expand All @@ -494,31 +490,27 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 10, 16, 2),
},
[1] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 10, 16, 2),
},
[2] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
.address = 2,
.scan_index = 2,
.scan_type = IIO_ST('u', 10, 16, 2),
},
[3] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 3,
.address = 3,
.scan_index = 3,
.scan_type = IIO_ST('u', 10, 16, 2),
},
Expand All @@ -534,31 +526,27 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 8, 16, 4),
},
[1] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 8, 16, 4),
},
[2] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
.address = 2,
.scan_index = 2,
.scan_type = IIO_ST('u', 8, 16, 4),
},
[3] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 3,
.address = 3,
.scan_index = 3,
.scan_type = IIO_ST('u', 8, 16, 4),
},
Expand All @@ -574,7 +562,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -583,7 +570,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -601,7 +587,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -610,7 +595,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -619,7 +603,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
.address = 2,
.scan_index = 2,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -628,7 +611,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 3,
.address = 3,
.scan_index = 3,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -646,7 +628,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -655,7 +636,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -664,7 +644,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
.address = 2,
.scan_index = 2,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -673,7 +652,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 3,
.address = 3,
.scan_index = 3,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -691,7 +669,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -700,7 +677,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -709,7 +685,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
.address = 2,
.scan_index = 2,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -718,7 +693,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 3,
.address = 3,
.scan_index = 3,
.scan_type = IIO_ST('u', 10, 16, 2),
.event_mask = AD799X_EV_MASK,
Expand All @@ -727,31 +701,27 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 4,
.address = 4,
.scan_index = 4,
.scan_type = IIO_ST('u', 10, 16, 2),
},
[5] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 5,
.address = 5,
.scan_index = 5,
.scan_type = IIO_ST('u', 10, 16, 2),
},
[6] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 6,
.address = 6,
.scan_index = 6,
.scan_type = IIO_ST('u', 10, 16, 2),
},
[7] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 7,
.address = 7,
.scan_index = 7,
.scan_type = IIO_ST('u', 10, 16, 2),
},
Expand All @@ -768,7 +738,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = 0,
.scan_index = 0,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -777,7 +746,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = 1,
.scan_index = 1,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -786,7 +754,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 2,
.address = 2,
.scan_index = 2,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -795,7 +762,6 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 3,
.address = 3,
.scan_index = 3,
.scan_type = IIO_ST('u', 12, 16, 0),
.event_mask = AD799X_EV_MASK,
Expand All @@ -804,31 +770,27 @@ static const struct ad799x_chip_info ad799x_chip_info_tbl[] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 4,
.address = 4,
.scan_index = 4,
.scan_type = IIO_ST('u', 12, 16, 0),
},
[5] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 5,
.address = 5,
.scan_index = 5,
.scan_type = IIO_ST('u', 12, 16, 0),
},
[6] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 6,
.address = 6,
.scan_index = 6,
.scan_type = IIO_ST('u', 12, 16, 0),
},
[7] = {
.type = IIO_VOLTAGE,
.indexed = 1,
.channel = 7,
.address = 7,
.scan_index = 7,
.scan_type = IIO_ST('u', 12, 16, 0),
},
Expand Down

0 comments on commit 58dffae

Please sign in to comment.