aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
commit43d2548bb2ef7e6d753f91468a746784041e522d (patch)
tree77d13fcd48fd998393abb825ec36e2b732684a73 /drivers/macintosh
parent585583d95c5660973bc0cf64add517b040acd8a4 (diff)
parent85082fd7cbe3173198aac0eb5e85ab1edcc6352c (diff)
Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
Manual fixup of: arch/powerpc/Kconfig
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/adb.c18
-rw-r--r--drivers/macintosh/ans-lcd.c2
-rw-r--r--drivers/macintosh/smu.c3
-rw-r--r--drivers/macintosh/via-pmu.c3
4 files changed, 21 insertions, 5 deletions
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 61b62a6f681b..e5d446804d32 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -643,12 +643,18 @@ do_adb_query(struct adb_request *req)
643static int adb_open(struct inode *inode, struct file *file) 643static int adb_open(struct inode *inode, struct file *file)
644{ 644{
645 struct adbdev_state *state; 645 struct adbdev_state *state;
646 int ret = 0;
646 647
647 if (iminor(inode) > 0 || adb_controller == NULL) 648 lock_kernel();
648 return -ENXIO; 649 if (iminor(inode) > 0 || adb_controller == NULL) {
650 ret = -ENXIO;
651 goto out;
652 }
649 state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); 653 state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL);
650 if (state == 0) 654 if (state == 0) {
651 return -ENOMEM; 655 ret = -ENOMEM;
656 goto out;
657 }
652 file->private_data = state; 658 file->private_data = state;
653 spin_lock_init(&state->lock); 659 spin_lock_init(&state->lock);
654 atomic_set(&state->n_pending, 0); 660 atomic_set(&state->n_pending, 0);
@@ -656,7 +662,9 @@ static int adb_open(struct inode *inode, struct file *file)
656 init_waitqueue_head(&state->wait_queue); 662 init_waitqueue_head(&state->wait_queue);
657 state->inuse = 1; 663 state->inuse = 1;
658 664
659 return 0; 665out:
666 unlock_kernel();
667 return ret;
660} 668}
661 669
662static int adb_release(struct inode *inode, struct file *file) 670static int adb_release(struct inode *inode, struct file *file)
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
index 73c50bc02095..6a8221893256 100644
--- a/drivers/macintosh/ans-lcd.c
+++ b/drivers/macintosh/ans-lcd.c
@@ -3,6 +3,7 @@
3 */ 3 */
4 4
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/smp_lock.h>
6#include <linux/errno.h> 7#include <linux/errno.h>
7#include <linux/kernel.h> 8#include <linux/kernel.h>
8#include <linux/miscdevice.h> 9#include <linux/miscdevice.h>
@@ -119,6 +120,7 @@ anslcd_ioctl( struct inode * inode, struct file * file,
119static int 120static int
120anslcd_open( struct inode * inode, struct file * file ) 121anslcd_open( struct inode * inode, struct file * file )
121{ 122{
123 cycle_kernel_lock();
122 return 0; 124 return 0;
123} 125}
124 126
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 76dbf25cb70f..96faa799b82a 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -19,6 +19,7 @@
19 * the userland interface 19 * the userland interface
20 */ 20 */
21 21
22#include <linux/smp_lock.h>
22#include <linux/types.h> 23#include <linux/types.h>
23#include <linux/kernel.h> 24#include <linux/kernel.h>
24#include <linux/device.h> 25#include <linux/device.h>
@@ -1090,10 +1091,12 @@ static int smu_open(struct inode *inode, struct file *file)
1090 pp->mode = smu_file_commands; 1091 pp->mode = smu_file_commands;
1091 init_waitqueue_head(&pp->wait); 1092 init_waitqueue_head(&pp->wait);
1092 1093
1094 lock_kernel();
1093 spin_lock_irqsave(&smu_clist_lock, flags); 1095 spin_lock_irqsave(&smu_clist_lock, flags);
1094 list_add(&pp->list, &smu_clist); 1096 list_add(&pp->list, &smu_clist);
1095 spin_unlock_irqrestore(&smu_clist_lock, flags); 1097 spin_unlock_irqrestore(&smu_clist_lock, flags);
1096 file->private_data = pp; 1098 file->private_data = pp;
1099 unlock_kernel();
1097 1100
1098 return 0; 1101 return 0;
1099} 1102}
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index d6365a9f0637..d524dc245a2c 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -18,6 +18,7 @@
18 * 18 *
19 */ 19 */
20#include <stdarg.h> 20#include <stdarg.h>
21#include <linux/smp_lock.h>
21#include <linux/types.h> 22#include <linux/types.h>
22#include <linux/errno.h> 23#include <linux/errno.h>
23#include <linux/kernel.h> 24#include <linux/kernel.h>
@@ -2047,6 +2048,7 @@ pmu_open(struct inode *inode, struct file *file)
2047 pp->rb_get = pp->rb_put = 0; 2048 pp->rb_get = pp->rb_put = 0;
2048 spin_lock_init(&pp->lock); 2049 spin_lock_init(&pp->lock);
2049 init_waitqueue_head(&pp->wait); 2050 init_waitqueue_head(&pp->wait);
2051 lock_kernel();
2050 spin_lock_irqsave(&all_pvt_lock, flags); 2052 spin_lock_irqsave(&all_pvt_lock, flags);
2051#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT) 2053#if defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_PMAC_BACKLIGHT)
2052 pp->backlight_locker = 0; 2054 pp->backlight_locker = 0;
@@ -2054,6 +2056,7 @@ pmu_open(struct inode *inode, struct file *file)
2054 list_add(&pp->list, &all_pmu_pvt); 2056 list_add(&pp->list, &all_pmu_pvt);
2055 spin_unlock_irqrestore(&all_pvt_lock, flags); 2057 spin_unlock_irqrestore(&all_pvt_lock, flags);
2056 file->private_data = pp; 2058 file->private_data = pp;
2059 unlock_kernel();
2057 return 0; 2060 return 0;
2058} 2061}
2059 2062