linux-stable/drivers/counter
Fabrice Gasnier 3170256d7b counter: chrdev: fix getting array extensions
When trying to watch a component array extension, and the array isn't the
first extended element, it fails as the type comparison is always done on
the 1st element. Fix it by indexing the 'ext' array.

Example on a dummy struct counter_comp:
static struct counter_comp dummy[] = {
	COUNTER_COMP_DIRECTION(..),
	...,
	COUNTER_COMP_ARRAY_CAPTURE(...),
};
static struct counter_count dummy_cnt = {
	...
	.ext = dummy,
	.num_ext = ARRAY_SIZE(dummy),
}

Currently, counter_get_ext() returns -EINVAL when trying to add a watch
event on one of the capture array element in such example.

Fixes: d2011be1e2 ("counter: Introduce the COUNTER_COMP_ARRAY component type")
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20230829134029.2402868-2-fabrice.gasnier@foss.st.com
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
2023-09-04 14:56:27 -04:00
..
104-quad-8.c counter: 104-quad-8: Migrate to the regmap API 2023-05-18 20:39:46 -04:00
counter-chrdev.c counter: chrdev: fix getting array extensions 2023-09-04 14:56:27 -04:00
counter-chrdev.h counter: Add character device interface 2021-10-17 10:53:52 +01:00
counter-core.c counter: Move symbols into COUNTER namespace 2022-09-30 14:32:35 +02:00
counter-sysfs.c counter: i8254: Introduce the Intel 8254 interface library module 2023-06-08 10:11:17 -04:00
counter-sysfs.h counter: Internalize sysfs interface code 2021-10-17 10:52:58 +01:00
ftm-quaddec.c counter: Move symbols into COUNTER namespace 2022-09-30 14:32:35 +02:00
i8254.c counter: i8254: Introduce the Intel 8254 interface library module 2023-06-08 10:11:17 -04:00
intel-qep.c counter: Move symbols into COUNTER namespace 2022-09-30 14:32:35 +02:00
interrupt-cnt.c counter: interrupt-cnt: Implement watch_validate callback 2022-09-30 14:32:35 +02:00
Kconfig First set of Counter fixes for 6.5 2023-08-04 15:17:29 +02:00
Makefile counter: i8254: Introduce the Intel 8254 interface library module 2023-06-08 10:11:17 -04:00
microchip-tcb-capture.c counter: microchip-tcb-capture: Handle Signal1 read and Synapse 2022-10-23 20:38:49 -04:00
rz-mtu3-cnt.c counter: rz-mtu3-cnt: Unlock on error in rz_mtu3_count_ceiling_write() 2023-04-26 11:40:35 +01:00
stm32-lptimer-cnt.c counter: stm32-lptimer-cnt: fix the check on arr and cmp registers update 2022-11-26 16:49:28 -05:00
stm32-timer-cnt.c counter: stm32-timer-cnt: Reset TIM_TISEL to its default value in probe 2023-05-09 19:17:17 -04:00
ti-ecap-capture.c counter: ti-ecap-capture: fix IS_ERR() vs NULL check 2022-10-17 09:51:29 -04:00
ti-eqep.c counter: Move symbols into COUNTER namespace 2022-09-30 14:32:35 +02:00