Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268170
b: refs/heads/master
c: c04ea8a
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent 9652818 commit 98536d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 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: e614a54b296185b266b4bd91193e08a5fbd32422
refs/heads/master: c04ea8ae99d71182b525cb8e4d48dc2fde0dd0ee
20 changes: 10 additions & 10 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,27 +791,27 @@ static int iio_device_add_event_sysfs(struct iio_dev *dev_info,

for_each_set_bit(i, &chan->event_mask, sizeof(chan->event_mask)*8) {
postfix = kasprintf(GFP_KERNEL, "%s_%s_en",
iio_ev_type_text[i/IIO_EV_TYPE_MAX],
iio_ev_dir_text[i%IIO_EV_TYPE_MAX]);
iio_ev_type_text[i/IIO_EV_DIR_MAX],
iio_ev_dir_text[i%IIO_EV_DIR_MAX]);
if (postfix == NULL) {
ret = -ENOMEM;
goto error_ret;
}
if (chan->modified)
mask = IIO_MOD_EVENT_CODE(chan->type, 0, chan->channel,
i/IIO_EV_TYPE_MAX,
i%IIO_EV_TYPE_MAX);
i/IIO_EV_DIR_MAX,
i%IIO_EV_DIR_MAX);
else if (chan->type == IIO_VOLTAGE_DIFF)
mask = IIO_MOD_EVENT_CODE(chan->type,
chan->channel,
chan->channel2,
i/IIO_EV_TYPE_MAX,
i%IIO_EV_TYPE_MAX);
i/IIO_EV_DIR_MAX,
i%IIO_EV_DIR_MAX);
else
mask = IIO_UNMOD_EVENT_CODE(chan->type,
chan->channel,
i/IIO_EV_TYPE_MAX,
i%IIO_EV_TYPE_MAX);
i/IIO_EV_DIR_MAX,
i%IIO_EV_DIR_MAX);

ret = __iio_add_chan_devattr(postfix,
chan,
Expand All @@ -827,8 +827,8 @@ static int iio_device_add_event_sysfs(struct iio_dev *dev_info,
goto error_ret;
attrcount++;
postfix = kasprintf(GFP_KERNEL, "%s_%s_value",
iio_ev_type_text[i/IIO_EV_TYPE_MAX],
iio_ev_dir_text[i%IIO_EV_TYPE_MAX]);
iio_ev_type_text[i/IIO_EV_DIR_MAX],
iio_ev_dir_text[i%IIO_EV_DIR_MAX]);
if (postfix == NULL) {
ret = -ENOMEM;
goto error_ret;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/iio/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ enum iio_event_direction {
(((u64)type << 56) | ((u64)direction << 48) | ((u64)modifier << 40) | \
((u64)chan_type << 32) | (chan2 << 16) | chan1 | chan)

#define IIO_EV_TYPE_MAX 8
#define IIO_EV_DIR_MAX 4
#define IIO_EV_BIT(type, direction) \
(1 << (type*IIO_EV_TYPE_MAX + direction))
(1 << (type*IIO_EV_DIR_MAX + direction))

#define IIO_MOD_EVENT_CODE(channelclass, number, modifier, \
type, direction) \
Expand Down

0 comments on commit 98536d2

Please sign in to comment.