diff options
author | Stefani Seibold <stefani@seibold.net> | 2009-12-21 17:37:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-22 17:17:56 -0500 |
commit | c1e13f25674ed564948ecb7dfe5f83e578892896 (patch) | |
tree | 24fac07b3e2b66dff01c3127b34077de1de4c101 /drivers/platform/x86/fujitsu-laptop.c | |
parent | 45465487897a1c6d508b14b904dc5777f7ec7e04 (diff) |
kfifo: move out spinlock
Move the pointer to the spinlock out of struct kfifo. Most users in
tree do not actually use a spinlock, so the few exceptions now have to
call kfifo_{get,put}_locked, which takes an extra argument to a
spinlock.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/platform/x86/fujitsu-laptop.c')
-rw-r--r-- | drivers/platform/x86/fujitsu-laptop.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index f999fba0e25e..13dc7bedcfce 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c | |||
@@ -825,7 +825,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) | |||
825 | /* kfifo */ | 825 | /* kfifo */ |
826 | spin_lock_init(&fujitsu_hotkey->fifo_lock); | 826 | spin_lock_init(&fujitsu_hotkey->fifo_lock); |
827 | error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int), | 827 | error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int), |
828 | GFP_KERNEL, &fujitsu_hotkey->fifo_lock); | 828 | GFP_KERNEL); |
829 | if (error) { | 829 | if (error) { |
830 | printk(KERN_ERR "kfifo_alloc failed\n"); | 830 | printk(KERN_ERR "kfifo_alloc failed\n"); |
831 | goto err_stop; | 831 | goto err_stop; |
@@ -1006,9 +1006,10 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) | |||
1006 | vdbg_printk(FUJLAPTOP_DBG_TRACE, | 1006 | vdbg_printk(FUJLAPTOP_DBG_TRACE, |
1007 | "Push keycode into ringbuffer [%d]\n", | 1007 | "Push keycode into ringbuffer [%d]\n", |
1008 | keycode); | 1008 | keycode); |
1009 | status = kfifo_put(&fujitsu_hotkey->fifo, | 1009 | status = kfifo_put_locked(&fujitsu_hotkey->fifo, |
1010 | (unsigned char *)&keycode, | 1010 | (unsigned char *)&keycode, |
1011 | sizeof(keycode)); | 1011 | sizeof(keycode), |
1012 | &fujitsu_hotkey->fifo_lock); | ||
1012 | if (status != sizeof(keycode)) { | 1013 | if (status != sizeof(keycode)) { |
1013 | vdbg_printk(FUJLAPTOP_DBG_WARN, | 1014 | vdbg_printk(FUJLAPTOP_DBG_WARN, |
1014 | "Could not push keycode [0x%x]\n", | 1015 | "Could not push keycode [0x%x]\n", |
@@ -1019,11 +1020,12 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) | |||
1019 | } | 1020 | } |
1020 | } else if (keycode == 0) { | 1021 | } else if (keycode == 0) { |
1021 | while ((status = | 1022 | while ((status = |
1022 | kfifo_get | 1023 | kfifo_get_locked( |
1023 | (&fujitsu_hotkey->fifo, (unsigned char *) | 1024 | &fujitsu_hotkey->fifo, |
1024 | &keycode_r, | 1025 | (unsigned char *) &keycode_r, |
1025 | sizeof | 1026 | sizeof(keycode_r), |
1026 | (keycode_r))) == sizeof(keycode_r)) { | 1027 | &fujitsu_hotkey->fifo_lock)) |
1028 | == sizeof(keycode_r)) { | ||
1027 | input_report_key(input, keycode_r, 0); | 1029 | input_report_key(input, keycode_r, 0); |
1028 | input_sync(input); | 1030 | input_sync(input); |
1029 | vdbg_printk(FUJLAPTOP_DBG_TRACE, | 1031 | vdbg_printk(FUJLAPTOP_DBG_TRACE, |