alistair23-linux/include
Alexandru Tachici 2ddc982a6c iio: industrialio-core: Fix debugfs read
Currently iio_debugfs_read_reg calls debugfs_reg_access
every time it is ran. Reading the same hardware register
multiple times during the same reading of a debugfs file
can cause unintended effects.

For example for each: cat iio:device0/direct_reg_access
the file_operations.read function will be called at least
twice. First will return the full length of the string in
bytes  and the second will return 0.

This patch makes iio_debugfs_read_reg to call debugfs_reg_access
only when the user's buffer position (*ppos) is 0. (meaning
it is the beginning of a new reading of the debugfs file).

Fixes: e553f182d5 ("staging: iio: core: Introduce debugfs support, add support for direct register access")
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08 17:28:51 +00:00
..
acpi
asm-generic
clocksource
crypto
drm
dt-bindings ARM: SoC: late updates 2020-02-08 14:17:27 -08:00
keys
kunit
kvm
linux iio: industrialio-core: Fix debugfs read 2020-03-08 17:28:51 +00:00
math-emu
media
misc
net
pcmcia
ras
rdma
scsi
soc ARM: SoC-related driver updates 2020-02-08 14:04:19 -08:00
sound ARM: Device-tree updates 2020-02-08 13:58:44 -08:00
target
trace ARM: SoC-related driver updates 2020-02-08 14:04:19 -08:00
uapi fs: New zonefs file system 2020-02-09 15:51:46 -08:00
vdso
video
xen