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

iio: accel: adxl345: make data struct variable irq function local

Remove variable irq from the struct state and make it a function local
variable, because it is not necessary to be kept struct-wise.

This is a refactoring change and should not impact functionality.

Signed-off-by: Lothar Rubusch <l.rubusch@gmail.com>
Link: https://patch.msgid.link/20250610215933.84795-3-l.rubusch@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Lothar Rubusch and committed by
Jonathan Cameron
5decafde 51180f03

+6 -6
+6 -6
drivers/iio/accel/adxl345_core.c
··· 133 133 const struct adxl345_chip_info *info; 134 134 struct regmap *regmap; 135 135 bool fifo_delay; /* delay: delay is needed for SPI */ 136 - int irq; 137 136 u8 watermark; 138 137 u8 fifo_mode; 139 138 ··· 1119 1120 ADXL345_DATA_FORMAT_FULL_RES | 1120 1121 ADXL345_DATA_FORMAT_SELF_TEST); 1121 1122 unsigned int tap_threshold; 1123 + int irq; 1122 1124 int ret; 1123 1125 1124 1126 indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); ··· 1204 1204 if (ret) 1205 1205 return ret; 1206 1206 1207 - st->irq = fwnode_irq_get_byname(dev_fwnode(dev), "INT1"); 1208 - if (st->irq < 0) { 1207 + irq = fwnode_irq_get_byname(dev_fwnode(dev), "INT1"); 1208 + if (irq < 0) { 1209 1209 intio = ADXL345_INT2; 1210 - st->irq = fwnode_irq_get_byname(dev_fwnode(dev), "INT2"); 1211 - if (st->irq < 0) 1210 + irq = fwnode_irq_get_byname(dev_fwnode(dev), "INT2"); 1211 + if (irq < 0) 1212 1212 intio = ADXL345_INT_NONE; 1213 1213 } 1214 1214 ··· 1233 1233 if (ret) 1234 1234 return ret; 1235 1235 1236 - ret = devm_request_threaded_irq(dev, st->irq, NULL, 1236 + ret = devm_request_threaded_irq(dev, irq, NULL, 1237 1237 &adxl345_irq_handler, 1238 1238 IRQF_SHARED | IRQF_ONESHOT, 1239 1239 indio_dev->name, indio_dev);