Skip to content

Commit 893579d

Browse files
committed
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
2 parents b1b102b + 08e2a66 commit 893579d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/counter/interrupt-cnt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#define INTERRUPT_CNT_NAME "interrupt-cnt"
1818

1919
struct interrupt_cnt_priv {
20-
atomic_t count;
20+
atomic_long_t count;
2121
struct gpio_desc *gpio;
2222
int irq;
2323
bool enabled;
@@ -32,7 +32,7 @@ static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id)
3232
struct counter_device *counter = dev_id;
3333
struct interrupt_cnt_priv *priv = counter_priv(counter);
3434

35-
atomic_inc(&priv->count);
35+
atomic_long_inc(&priv->count);
3636

3737
counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0);
3838

@@ -96,7 +96,7 @@ static int interrupt_cnt_read(struct counter_device *counter,
9696
{
9797
struct interrupt_cnt_priv *priv = counter_priv(counter);
9898

99-
*val = atomic_read(&priv->count);
99+
*val = atomic_long_read(&priv->count);
100100

101101
return 0;
102102
}
@@ -109,7 +109,7 @@ static int interrupt_cnt_write(struct counter_device *counter,
109109
if (val != (typeof(priv->count.counter))val)
110110
return -ERANGE;
111111

112-
atomic_set(&priv->count, val);
112+
atomic_long_set(&priv->count, val);
113113

114114
return 0;
115115
}

0 commit comments

Comments
 (0)