mirror-linux/include/linux/iio
Matti Vaittinen 0a33755c4b iio: Don't silently expect attribute types
The iio_triggered_buffer_setup_ext() and the
devm_iio_kfifo_buffer_setup_ext() were changed by
commit 15097c7a1a ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
to silently expect that all attributes given in buffer_attrs array are
device-attributes. This expectation was not forced by the API - and some
drivers did register attributes created by IIO_CONST_ATTR().

When using IIO_CONST_ATTRs the added attribute "wrapping" does not copy
the pointer to stored string constant and when the sysfs file is read the
kernel will access to invalid location.

Change the function signatures to expect an array of iio_dev_attrs to
avoid similar errors in the future.

Merge conflict resolved whilst applying due to patch crossing with
two new drivers (kx022a accelerometer and ad4130 ADC).

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-11-23 19:44:04 +00:00
..
accel
adc Char / Misc / Other smaller driver subsystem updates for 5.19-rc1 2022-06-03 11:36:34 -07:00
afe iio: afe: rescale: add offset support 2022-02-27 13:38:10 +00:00
common iio: st_sensors: core and lsm9ds0 switch to devm_regulator_bulk_get_enable() 2022-11-23 19:44:01 +00:00
dac dt-bindings:iio:dac: update microchip,mcp4725.yaml reference 2021-04-07 08:36:38 +01:00
frequency
gyro iio: gyro: itg3200_core: do not use internal iio_dev lock 2022-11-23 19:43:58 +00:00
imu iio: adis: stylistic changes 2022-01-23 18:03:37 +00:00
timer
buffer-dma.h iio: buffer-dma: Remove unused iio_buffer_block struct 2021-11-27 15:12:01 +00:00
buffer-dmaengine.h iio: buffer-dma,adi-axi-adc: introduce devm_iio_dmaengine_buffer_setup() 2021-03-11 20:47:02 +00:00
buffer.h iio: Add output buffer support 2021-10-19 08:30:44 +01:00
buffer_impl.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
configfs.h
consumer.h iio: inkern: remove OF dependencies 2022-08-15 22:30:00 +01:00
driver.h iio: inkern: introduce devm_iio_map_array_register() short-hand function 2021-10-19 08:27:34 +01:00
events.h
hw-consumer.h
iio-opaque.h iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00
iio.h iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00
kfifo_buf.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
machine.h
sw_device.h
sw_trigger.h
sysfs.h iio: Add IIO_STATIC_CONST_DEVICE_ATTR 2022-11-23 19:44:03 +00:00
trigger.h iio: trigger: move trig->owner init to trigger allocate() stage 2022-07-16 16:24:19 +01:00
trigger_consumer.h
triggered_buffer.h iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
triggered_event.h
types.h iio: Add new event type gesture and use direction for single and double tap 2022-09-05 18:08:42 +01:00