[PATCH RFC 5/5] iio: sysfs: drop core-only fields from struct iio_dev_attr

From: Rodrigo Alencar via B4 Relay

Date: Fri Nov 20 2026 - 13:06:38 EST


From: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>

The list node, channel spec and buffer pointer of struct iio_dev_attr
are now only used through struct iio_chan_attr and the types extending
it. Remove them, so that attributes declared by drivers through
IIO_DEVICE_ATTR*() and friends no longer carry them.

On 64-bit, without lockdep, this shrinks struct iio_dev_attr from 72 to
40 bytes.

Signed-off-by: Rodrigo Alencar <rodrigo.alencar@xxxxxxxxxx>
---
include/linux/iio/sysfs.h | 9 ---------
1 file changed, 9 deletions(-)

diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h
index de5bb125815c..1e4122b8c13a 100644
--- a/include/linux/iio/sysfs.h
+++ b/include/linux/iio/sysfs.h
@@ -9,23 +9,14 @@
#ifndef _INDUSTRIAL_IO_SYSFS_H_
#define _INDUSTRIAL_IO_SYSFS_H_

-struct iio_buffer;
-struct iio_chan_spec;
-
/**
* struct iio_dev_attr - iio specific device attribute
* @dev_attr: underlying device attribute
* @address: associated register address
- * @l: list head for maintaining list of dynamically created attrs
- * @c: specification for the underlying channel
- * @buffer: the IIO buffer to which this attribute belongs to (if any)
*/
struct iio_dev_attr {
struct device_attribute dev_attr;
u64 address;
- struct list_head l;
- struct iio_chan_spec const *c;
- struct iio_buffer *buffer;
};

#define to_iio_dev_attr(_dev_attr) \

--
2.43.0