]> git.baikalelectronics.ru Git - kernel.git/commit
iio: add support for binary attributes
authorAndrea Merello <andrea.merello@iit.it>
Wed, 7 Sep 2022 13:21:58 +0000 (15:21 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 21 Sep 2022 17:42:55 +0000 (18:42 +0100)
commit2b73987bc4b77e8fbd3aa0c75a91c3ce604ff6f8
tree4f09a25ea44e9471bd08852a794e478d6b2fcf5c
parent54049fdf607996f3086b3f9d96fb37d781b9a20e
iio: add support for binary attributes

When a IIO device is registered, the IIO core creates an attribute group on
its own, where it puts the channel attributes, and where it copies the
attributes in indio_dev->info->attrs.

Unfortunately it doesn't take care of binary attributes (i.e. it only
consider indio_dev->info->attrs->attrs, and it ignores
indio_dev->info->attrs->bin_attrs).

Fix this by making the IIO layer take care also of the binary attributes.

Note that while it is necessary to copy the non-binary attributes because
the IIO layer needs more room to add the channels attribute, it should be
enough to assign the bin_attrs pointer to the binary attributes pointed by
indio_dev->info->attrs->bin_attrs.

Signed-off-by: Andrea Merello <andrea.merello@iit.it>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220907132205.28021-8-andrea.merello@iit.it
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-core.c