Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267537
b: refs/heads/master
c: 232b9cb
h: refs/heads/master
i:
  267535: 3b30a70
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Aug 23, 2011
1 parent 5bcbe7e commit 615e5ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 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: 17ee97e5f30995baf00f490e3facfea9996630ab
refs/heads/master: 232b9cba130025d47531c5c539d6affc64950213
22 changes: 7 additions & 15 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,18 +1004,17 @@ static int iio_device_add_event_sysfs(struct iio_dev *dev_info,
return ret;
}

static inline void __iio_remove_all_event_sysfs(struct iio_dev *dev_info,
const char *groupname,
int num)
static inline void __iio_remove_event_config_attrs(struct iio_dev *dev_info,
int i)
{
struct iio_dev_attr *p, *n;
list_for_each_entry_safe(p, n,
&dev_info->event_interfaces[num].
&dev_info->event_interfaces[i].
dev_attr_list, l) {
sysfs_remove_file_from_group(&dev_info
->event_interfaces[num].dev.kobj,
->event_interfaces[i].dev.kobj,
&p->dev_attr.attr,
groupname);
NULL);
kfree(p->dev_attr.attr.name);
kfree(p);
}
Expand All @@ -1025,7 +1024,7 @@ static inline int __iio_add_event_config_attrs(struct iio_dev *dev_info, int i)
{
int j;
int ret;
INIT_LIST_HEAD(&dev_info->event_interfaces[0].dev_attr_list);
INIT_LIST_HEAD(&dev_info->event_interfaces[i].dev_attr_list);
/* Dynically created from the channels array */
if (dev_info->channels) {
for (j = 0; j < dev_info->num_channels; j++) {
Expand All @@ -1039,18 +1038,11 @@ static inline int __iio_add_event_config_attrs(struct iio_dev *dev_info, int i)
return 0;

error_clear_attrs:
__iio_remove_all_event_sysfs(dev_info, NULL, i);
__iio_remove_event_config_attrs(dev_info, i);

return ret;
}

static inline int __iio_remove_event_config_attrs(struct iio_dev *dev_info,
int i)
{
__iio_remove_all_event_sysfs(dev_info, NULL, i);
return 0;
}

static int iio_device_register_eventset(struct iio_dev *dev_info)
{
int ret = 0, i, j;
Expand Down

0 comments on commit 615e5ae

Please sign in to comment.