Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304376
b: refs/heads/master
c: 75a973c
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Apr 18, 2012
1 parent 3f6457b commit 03dd167
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8c0ed756574ba5a484cd8238892f88501ff400d
refs/heads/master: 75a973c7546ffae3b3c3fdb22211f1f59c01b0fa
20 changes: 4 additions & 16 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ static const char * const iio_modifier_names[] = {

/* relies on pairs of these shared then separate */
static const char * const iio_chan_info_postfix[] = {
[IIO_CHAN_INFO_RAW] = "raw",
[IIO_CHAN_INFO_PROCESSED] = "input",
[IIO_CHAN_INFO_SCALE] = "scale",
[IIO_CHAN_INFO_OFFSET] = "offset",
[IIO_CHAN_INFO_CALIBSCALE] = "calibscale",
Expand Down Expand Up @@ -577,26 +579,12 @@ static int iio_device_add_channel_sysfs(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan)
{
int ret, attrcount = 0;
int i = 4;
int i;
const struct iio_chan_spec_ext_info *ext_info;

if (chan->channel < 0)
return 0;

ret = __iio_add_chan_devattr(iio_data_type_name[chan->processed_val],
chan,
&iio_read_channel_info,
(chan->output ?
&iio_write_channel_info : NULL),
0,
0,
&indio_dev->dev,
&indio_dev->channel_attr_list);
if (ret)
goto error_ret;
attrcount++;

for_each_set_bit_from(i, &chan->info_mask, sizeof(long)*8) {
for_each_set_bit(i, &chan->info_mask, sizeof(long)*8) {
ret = __iio_add_chan_devattr(iio_chan_info_postfix[i/2],
chan,
&iio_read_channel_info,
Expand Down

0 comments on commit 03dd167

Please sign in to comment.