iio: remove unused struct fields across drivers
Subsystems (8)
Antoniu Miclaus
maintainerv2 cover iio: remove unused struct fields across drivers
This series removes unused struct fields found across various IIO drivers. These fields were either left over from previous refactoring, or were added during development but never actually used.
Removing them reduces memory footprint slightly and improves code clarity by eliminating dead struct members that could confuse future readers.
Each patch is independent and can be merged separately as they touch different drivers with no dependencies between them.
Changes since v1:
- Reformatted as proper series with cover letter and numbering
Antoniu Miclaus (13):
iio: adc: ad4080: remove unused dec_rate field
iio: adc: ad7768-1: remove unused mclk_div field
iio: adc: ad7793: remove unused int_vref_mv field
iio: adc: ad9467: remove unused output_mode field
iio: adc: max1363: remove unused requestedmask field
iio: adc: nau7802: remove unused min_conversions field
iio: adc: ti-ads1015: remove unused enabled field
iio: dac: adi-axi-dac: remove unused int_tone field
iio: dac: ti-dac5571: remove unused id field
iio: humidity: hdc2010: remove unused interrupt_config
iio: imu: bmi323: remove unused drdy_trigger_enabled
iio: light: apds9306: remove unused nlux_per_count
iio: light: gp2ap020a00f: remove unused debug_reg_addr
drivers/iio/adc/ad4080.c | 1 - drivers/iio/adc/ad7768-1.c | 1 - drivers/iio/adc/ad7793.c | 1 - drivers/iio/adc/ad9467.c | 1 - drivers/iio/adc/max1363.c | 2 -- drivers/iio/adc/nau7802.c | 1 - drivers/iio/adc/ti-ads1015.c | 1 - drivers/iio/dac/adi-axi-dac.c | 1 - drivers/iio/dac/ti-dac5571.c | 1 - drivers/iio/humidity/hdc2010.c | 1 - drivers/iio/imu/bmi323/bmi323_core.c | 1 - drivers/iio/light/apds9306.c | 2 -- drivers/iio/light/gp2ap020a00f.c | 1 - 13 files changed, 15 deletions(-)
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 1/13 iio: adc: ad4080: remove unused dec_rate field
Remove unused dec_rate field from ad4080_state struct. The driver reads/writes decimation rate directly from hardware registers via ad4080_get_dec_rate() and ad4080_set_dec_rate() functions.
--- drivers/iio/adc/ad4080.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/ad4080.c +0 -1
@@ -185,7 +185,6 @@ struct ad4080_state {*/ struct mutex lock;unsigned int num_lanes; -unsigned int dec_rate;unsigned long clk_rate;enum ad4080_filter_type filter_type;bool lvds_cnv_en;
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 2/13 iio: adc: ad7768-1: remove unused mclk_div field
In reply to Antoniu MiclausRemove unused mclk_div field from ad7768_state struct. The field is declared but never accessed in the driver.
--- drivers/iio/adc/ad7768-1.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/ad7768-1.c +0 -1
@@ -290,7 +290,6 @@ struct ad7768_state {unsigned int vcm_output_sel;struct clk *mclk;unsigned int mclk_freq; -unsigned int mclk_div;unsigned int oversampling_ratio;enum ad7768_filter_type filter_type;unsigned int samp_freq;
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 3/13 iio: adc: ad7793: remove unused int_vref_mv field
In reply to Antoniu MiclausRemove unused int_vref_mv field from ad7793_state struct. The field is declared but never accessed in the driver.
--- drivers/iio/adc/ad7793.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/ad7793.c +0 -1
@@ -152,7 +152,6 @@ struct ad7793_chip_info {struct ad7793_state {const struct ad7793_chip_info *chip_info; -u16 int_vref_mv;u16 mode;u16 conf;u32 scale_avail[8 ][2 ];
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 4/13 iio: adc: ad9467: remove unused output_mode field
In reply to Antoniu MiclausRemove unused output_mode field from ad9467_state struct. The field is declared but never accessed in the driver.
--- drivers/iio/adc/ad9467.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/ad9467.c +0 -1
@@ -176,7 +176,6 @@ struct ad9467_state {struct clk *clk;/* used for debugfs */ struct ad9467_chan_test_mode *chan_test; -unsigned int output_mode;unsigned int (*scales)[2 ];/* * Times 2 because we may also invert the signal polarity and run the
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 5/13 iio: adc: max1363: remove unused requestedmask field
In reply to Antoniu MiclausRemove unused requestedmask field from max1363_state struct. The field is declared but never accessed in the driver.
--- drivers/iio/adc/max1363.c | 2 -- 1 file changed, 2 deletions(-)
drivers/iio/adc/max1363.c +0 -2
@@ -149,7 +149,6 @@ struct max1363_chip_info {* @configbyte: cache of current device config byte * @chip_info: chip model specific constants, available modes, etc. * @current_mode: the scan mode of this chip -* @requestedmask: a valid requested set of channels * @lock: lock to ensure state is consistent * @monitor_on: whether monitor mode is enabled * @monitor_speed: parameter corresponding to device monitor speed setting
@@ -169,7 +168,6 @@ struct max1363_state {u8 configbyte;const struct max1363_chip_info *chip_info;const struct max1363_mode *current_mode; -u32 requestedmask;struct mutex lock;/* Using monitor modes and buffer at the same time is
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 6/13 iio: adc: nau7802: remove unused min_conversions field
In reply to Antoniu MiclausRemove unused min_conversions field from nau7802_state struct. The field is declared but never accessed in the driver.
--- drivers/iio/adc/nau7802.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/nau7802.c +0 -1
@@ -55,7 +55,6 @@ struct nau7802_state {struct mutex data_lock;u32 vref_mv;u32 conversion_count; -u32 min_conversions;u8 sample_rate;u32 scale_avail[8 ];struct completion value_ok;
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 7/13 iio: adc: ti-ads1015: remove unused enabled field
In reply to Antoniu MiclausRemove unused enabled field from ads1015_channel_data struct. The field is declared but never accessed in the driver.
--- drivers/iio/adc/ti-ads1015.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/adc/ti-ads1015.c +0 -1
@@ -231,7 +231,6 @@ static const struct iio_event_spec ads1015_events[] = { }struct ads1015_channel_data { -bool enabled;unsigned int pga;unsigned int data_rate; };
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 8/13 iio: dac: adi-axi-dac: remove unused int_tone field
In reply to Antoniu MiclausRemove unused int_tone field from axi_dac_state struct. The field is declared but never accessed in the driver.
--- drivers/iio/dac/adi-axi-dac.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/dac/adi-axi-dac.c +0 -1
@@ -114,7 +114,6 @@ struct axi_dac_state {const struct axi_dac_info *info;u64 dac_clk;u32 reg_config; -bool int_tone;int dac_clk_rate; };
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 9/13 iio: dac: ti-dac5571: remove unused id field
In reply to Antoniu MiclausRemove unused id field from dac5571_data struct. The field is declared but never accessed in the driver.
--- drivers/iio/dac/ti-dac5571.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/dac/ti-dac5571.c +0 -1
@@ -45,7 +45,6 @@ static const struct dac5571_spec dac5571_spec[] = {struct dac5571_data {struct i2c_client *client; -int id;struct mutex lock;struct regulator *vref;u16 val[4 ];
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 10/13 iio: humidity: hdc2010: remove unused interrupt_config
In reply to Antoniu MiclausRemove unused interrupt_config field from hdc2010_data struct. The field is declared but never accessed in the driver.
--- drivers/iio/humidity/hdc2010.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/humidity/hdc2010.c +0 -1
@@ -44,7 +44,6 @@ struct hdc2010_data {struct i2c_client *client;struct mutex lock;u8 measurement_config; -u8 interrupt_config;u8 drdy_config; };
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 11/13 iio: imu: bmi323: remove unused drdy_trigger_enabled
In reply to Antoniu MiclausRemove unused drdy_trigger_enabled field from bmi323_data struct. The field is declared but never accessed in the driver.
--- drivers/iio/imu/bmi323/bmi323_core.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/imu/bmi323/bmi323_core.c +0 -1
@@ -156,7 +156,6 @@ struct bmi323_data {struct iio_mount_matrix orientation;enum bmi323_irq_pin irq_pin;struct iio_trigger *trig; -bool drdy_trigger_enabled;enum bmi323_state state;s64 fifo_tstamp, old_fifo_tstamp;u32 odrns[BMI323_SENSORS_CNT ];
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 12/13 iio: light: apds9306: remove unused nlux_per_count
In reply to Antoniu MiclausRemove unused nlux_per_count field from apds9306_data struct. The field is declared but never accessed in the driver.
--- drivers/iio/light/apds9306.c | 2 -- 1 file changed, 2 deletions(-)
drivers/iio/light/apds9306.c +0 -2
@@ -168,7 +168,6 @@ struct apds9306_regfields {* respectively. * @regmap: Regmap structure pointer * @rf: Regmap register fields structure -* @nlux_per_count: Nano lux per ADC count for a particular model * @read_data_available: Flag set by IRQ handler for ADC data available */ struct apds9306_data {
@@ -180,7 +179,6 @@ struct apds9306_data {struct regmap *regmap;struct apds9306_regfields rf; -int nlux_per_count;int read_data_available; };
Signature · 1 line
2.43.0
Antoniu Miclaus
maintainerPATCH v2 13/13 iio: light: gp2ap020a00f: remove unused debug_reg_addr
In reply to Antoniu MiclausRemove unused debug_reg_addr field from gp2ap020a00f_data struct. The field is declared but never accessed in the driver.
--- drivers/iio/light/gp2ap020a00f.c | 1 - 1 file changed, 1 deletion(-)
drivers/iio/light/gp2ap020a00f.c +0 -1
@@ -246,7 +246,6 @@ struct gp2ap020a00f_data {struct iio_trigger *trig;struct regmap *regmap;unsigned int thresh_val[4 ]; -u8 debug_reg_addr;struct irq_work work;wait_queue_head_t data_ready_queue; };
Signature · 1 line
2.43.0
Re: [PATCH v2 04/13] iio: adc: ad9467: remove unused output_mode field
In reply to Antoniu MiclausQuoted 4 lines · Antoniu Miclaus
Remove unused
output_modefield fromad9467_statestruct. The field is declared but never accessed in the driver.Signed-off-by Antoniu Miclaus <[email protected]>
Quoted 16 lines
--- drivers/iio/adc/ad9467.c | 1 - 1 file changed, 1 deletion(-)drivers/iio/adc/ad9467.c +0
-1@@ -176,7 +176,6 @@ struct ad9467_state {struct clk *clk;/* used for debugfs */ struct ad9467_chan_test_mode *chan_test; -unsigned int output_mode;unsigned int (*scales)[2 ];/* * Times 2 because we may also invert the signal polarity and run the
Re: [PATCH v2 11/13] iio: imu: bmi323: remove unused drdy_trigger_enabled
In reply to Antoniu MiclausQuoted 3 lines · Antoniu Miclaus
Remove unused
drdy_trigger_enabledfield frombmi323_datastruct. The field is declared but never accessed in the driver.
...
drivers/iio/imu/bmi323/bmi323_core.c struct bmi323_data { · line 159
Quoted 6 lines
struct
bmi323_data{drivers/iio/imu/bmi323/bmi323_core.c +0
-1struct iio_mount_matrix orientation;enum bmi323_irq_pin irq_pin;struct iio_trigger *trig; -bool drdy_trigger_enabled;
Hmm... Not directly related to your series, but with it applied it makes sense to revisit the structure layouts as they might be rearranged to occupy less space.
Quoted 1 line
enum
bmi323_statestate;
For example, this enum, if moved closer to irq_pin, might result in less gap on some architectures. (Probably not, as we use long, id est 'int' sized, enums.)
In any way, pahole can hint about that, but as I said, it's not for this series.
Quoted 2 lines
drivers/iio/imu/bmi323/bmi323_core.c +0
-0s64 fifo_tstamp, old_fifo_tstamp;u32 odrns[BMI323_SENSORS_CNT ];
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 10 lines · Antoniu Miclaus
This series removes unused struct fields found across various IIO drivers. These fields were either left over from previous refactoring, or were added during development but never actually used.
Removing them reduces memory footprint slightly and improves code clarity by eliminating dead struct members that could confuse future readers.
Each patch is independent and can be merged separately as they touch different drivers with no dependencies between them.
Assuming it applies cleanly and compiles,
and I see in some cases it gains space.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · On Tue, 3 Feb 2026 11:44:45 +0200 Andy Shevchenko…
Quoted 8 lines · Antoniu Miclaus
This series removes unused struct fields found across various IIO drivers. These fields were either left over from previous refactoring, or were added during development but never actually used.
Removing them reduces memory footprint slightly and improves code clarity by eliminating dead struct members that could confuse future readers.
Quoted 7 lines
Quoted 2 lines
Each patch is independent and can be merged separately as they touch different drivers with no dependencies between them.
Assuming it applies cleanly and compiles,
Reviewed-by Andy Shevchenko <[email protected]>and I see in some cases it gains space.
Applied. Thanks!
J
Jonathan Cameron
maintainerQuoted 15 lines · On Thu, 5 Feb 2026 20:45:32 +0000 Jonathan Cameron <[email protected]> wrote:
Quoted 12 lines · On Tue, 3 Feb 2026 11:44:45 +0200 Andy Shevchenko…
Quoted 10 lines · Antoniu Miclaus
This series removes unused struct fields found across various IIO drivers. These fields were either left over from previous refactoring, or were added during development but never actually used.
Removing them reduces memory footprint slightly and improves code clarity by eliminating dead struct members that could confuse future readers.
Each patch is independent and can be merged separately as they touch different drivers with no dependencies between them.
Quoted 7 lines
Quoted 4 lines
Assuming it applies cleanly and compiles,
Reviewed-by Andy Shevchenko <[email protected]>and I see in some cases it gains space.
Applied. Thanks!
Unfortunately I was a Muppet and applied this to a temporary tree then lost it. Now it's actually on the testing branch of iio.git.
Thanks,
Jonathan
Quoted 2 lines
J