Skip to content

Commit 2e03680

Browse files
commodojic23
authored andcommitted
iio: buffer: remove 'scan_el_attrs' attribute group from buffer struct
This field doesn't seem used. It seems that only 'buffer->attrs' was ever used to extend sysfs attributes for an IIO buffer. Moving forward, it may not make sense to keep it. This patch removes the field and it's initialization code. Since we want to rework IIO buffer, to be able to add more buffers per IIO device, we will merge [somehow] the 'buffer' & 'scan_elements' groups, and we will continue to add the attributes to the 'buffer' group. Removing it here, will also make the rework here a bit smaller, since this code will not be present. Signed-off-by: Alexandru Ardelean <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 97f1755 commit 2e03680

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

drivers/iio/industrialio-buffer.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,11 +1283,6 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
12831283

12841284
indio_dev->groups[indio_dev->groupcounter++] = &buffer->buffer_group;
12851285

1286-
if (buffer->scan_el_attrs != NULL) {
1287-
attr = buffer->scan_el_attrs->attrs;
1288-
while (*attr++ != NULL)
1289-
attrcount_orig++;
1290-
}
12911286
attrcount = attrcount_orig;
12921287
INIT_LIST_HEAD(&buffer->scan_el_dev_attr_list);
12931288
channels = indio_dev->channels;
@@ -1325,9 +1320,6 @@ int iio_buffer_alloc_sysfs_and_mask(struct iio_dev *indio_dev)
13251320
ret = -ENOMEM;
13261321
goto error_free_scan_mask;
13271322
}
1328-
if (buffer->scan_el_attrs)
1329-
memcpy(buffer->scan_el_group.attrs, buffer->scan_el_attrs,
1330-
sizeof(buffer->scan_el_group.attrs[0])*attrcount_orig);
13311323
attrn = attrcount_orig;
13321324

13331325
list_for_each_entry(p, &buffer->scan_el_dev_attr_list, l)

include/linux/iio/buffer_impl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,6 @@ struct iio_buffer {
9494
unsigned int watermark;
9595

9696
/* private: */
97-
/*
98-
* @scan_el_attrs: Control of scan elements if that scan mode
99-
* control method is used.
100-
*/
101-
struct attribute_group *scan_el_attrs;
102-
10397
/* @scan_timestamp: Does the scan mode include a timestamp. */
10498
bool scan_timestamp;
10599

0 commit comments

Comments
 (0)