Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Alexandru Ardelean and committed by
Jonathan Cameron
2e036804 97f1755e

-14
-8
drivers/iio/industrialio-buffer.c
··· 1283 1283 1284 1284 indio_dev->groups[indio_dev->groupcounter++] = &buffer->buffer_group; 1285 1285 1286 - if (buffer->scan_el_attrs != NULL) { 1287 - attr = buffer->scan_el_attrs->attrs; 1288 - while (*attr++ != NULL) 1289 - attrcount_orig++; 1290 - } 1291 1286 attrcount = attrcount_orig; 1292 1287 INIT_LIST_HEAD(&buffer->scan_el_dev_attr_list); 1293 1288 channels = indio_dev->channels; ··· 1320 1325 ret = -ENOMEM; 1321 1326 goto error_free_scan_mask; 1322 1327 } 1323 - if (buffer->scan_el_attrs) 1324 - memcpy(buffer->scan_el_group.attrs, buffer->scan_el_attrs, 1325 - sizeof(buffer->scan_el_group.attrs[0])*attrcount_orig); 1326 1328 attrn = attrcount_orig; 1327 1329 1328 1330 list_for_each_entry(p, &buffer->scan_el_dev_attr_list, l)
-6
include/linux/iio/buffer_impl.h
··· 94 94 unsigned int watermark; 95 95 96 96 /* 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 - 103 97 /* @scan_timestamp: Does the scan mode include a timestamp. */ 104 98 bool scan_timestamp; 105 99