diff options
author | 2025-05-21 14:07:53 +0200 | |
---|---|---|
committer | 2025-05-21 14:07:53 +0200 | |
commit | 893579d9e3e26bed34de0bcffacd75b38c330df1 (patch) | |
tree | 31004e7c5f715d2917cb94f74073f71afda8177d | |
parent | Merge tag 'counter-fixes-for-6.15' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-next (diff) | |
parent | counter: interrupt-cnt: Convert atomic_t -> atomic_long_t (diff) | |
download | linux-rng-893579d9e3e26bed34de0bcffacd75b38c330df1.tar.xz linux-rng-893579d9e3e26bed34de0bcffacd75b38c330df1.zip |
Merge tag 'counter-updates-for-6.16' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter into char-misc-next
William writes:
Counter updates for 6.16
An update to allow for larger count values in interrupt-cnt.
* tag 'counter-updates-for-6.16' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/wbg/counter:
counter: interrupt-cnt: Convert atomic_t -> atomic_long_t
-rw-r--r-- | drivers/counter/interrupt-cnt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c index d83848d0fe2a..6c0c1d2d7027 100644 --- a/drivers/counter/interrupt-cnt.c +++ b/drivers/counter/interrupt-cnt.c @@ -17,7 +17,7 @@ #define INTERRUPT_CNT_NAME "interrupt-cnt" struct interrupt_cnt_priv { - atomic_t count; + atomic_long_t count; struct gpio_desc *gpio; int irq; bool enabled; @@ -32,7 +32,7 @@ static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id) struct counter_device *counter = dev_id; struct interrupt_cnt_priv *priv = counter_priv(counter); - atomic_inc(&priv->count); + atomic_long_inc(&priv->count); counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0); @@ -96,7 +96,7 @@ static int interrupt_cnt_read(struct counter_device *counter, { struct interrupt_cnt_priv *priv = counter_priv(counter); - *val = atomic_read(&priv->count); + *val = atomic_long_read(&priv->count); return 0; } @@ -109,7 +109,7 @@ static int interrupt_cnt_write(struct counter_device *counter, if (val != (typeof(priv->count.counter))val) return -ERANGE; - atomic_set(&priv->count, val); + atomic_long_set(&priv->count, val); return 0; } |