Skip to content

Commit 5d164a0

Browse files
committed
Merge tag 'counter-fixes-for-6.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-linus
William writes: First set of Counter fixes for 6.6 The counter_get_ext() function would incorrectly refer to the first element of the extensions array to handle component array extensions when they are located at a different index; a fix is provided to index to the correct element in the array for this case. A fix for the microchip-tcb-capture is provided as well to correct an inverted internal GCLK logic for clock selection. * tag 'counter-fixes-for-6.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/wbg/counter: counter: microchip-tcb-capture: Fix the use of internal GCLK logic counter: chrdev: fix getting array extensions
2 parents 8a749fd + df8fdd0 commit 5d164a0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/counter/counter-chrdev.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ static int counter_get_ext(const struct counter_comp *const ext,
247247
if (*id == component_id)
248248
return 0;
249249

250-
if (ext->type == COUNTER_COMP_ARRAY) {
251-
element = ext->priv;
250+
if (ext[*ext_idx].type == COUNTER_COMP_ARRAY) {
251+
element = ext[*ext_idx].priv;
252252

253253
if (component_id - *id < element->length)
254254
return 0;

drivers/counter/microchip-tcb-capture.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int mchp_tc_count_function_write(struct counter_device *counter,
9797
priv->qdec_mode = 0;
9898
/* Set highest rate based on whether soc has gclk or not */
9999
bmr &= ~(ATMEL_TC_QDEN | ATMEL_TC_POSEN);
100-
if (priv->tc_cfg->has_gclk)
100+
if (!priv->tc_cfg->has_gclk)
101101
cmr |= ATMEL_TC_TIMER_CLOCK2;
102102
else
103103
cmr |= ATMEL_TC_TIMER_CLOCK1;

0 commit comments

Comments
 (0)