diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/adb.c | 18 | ||||
-rw-r--r-- | drivers/macintosh/ans-lcd.c | 2 | ||||
-rw-r--r-- | drivers/macintosh/smu.c | 3 | ||||
-rw-r--r-- | drivers/macintosh/via-pmu.c | 3 |
4 files changed, 21 insertions, 5 deletions
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index dbaad39020a1..40c70ba62bf0 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
@@ -644,12 +644,18 @@ do_adb_query(struct adb_request *req) | |||
644 | static int adb_open(struct inode *inode, struct file *file) | 644 | static int adb_open(struct inode *inode, struct file *file) |
645 | { | 645 | { |
646 | struct adbdev_state *state; | 646 | struct adbdev_state *state; |
647 | int ret = 0; | ||
647 | 648 | ||
648 | if (iminor(inode) > 0 || adb_controller == NULL) | 649 | lock_kernel(); |
649 | return -ENXIO; | 650 | if (iminor(inode) > 0 || adb_controller == NULL) { |
651 | ret = -ENXIO; | ||
652 | goto out; | ||
653 | } | ||
650 | state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); | 654 | state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); |
651 | if (state == 0) | 655 | if (state == 0) { |
652 | return -ENOMEM; | 656 | ret = -ENOMEM; |
657 | goto out; | ||
658 | } | ||
653 | file->private_data = state; | 659 | file->private_data = state; |
654 | spin_lock_init(&state->lock); | 660 | spin_lock_init(&state->lock); |
655 | atomic_set(&state->n_pending, 0); | 661 | atomic_set(&state->n_pending, 0); |
@@ -657,7 +663,9 @@ static int adb_open(struct inode *inode, struct file *file) | |||
657 | init_waitqueue_head(&state->wait_queue); | 663 | init_waitqueue_head(&state->wait_queue); |
658 | state->inuse = 1; | 664 | state->inuse = 1; |
659 | 665 | ||
660 | return 0; | 666 | out: |
667 | unlock_kernel(); | ||
668 | return ret; | ||
661 | } | 669 | } |
662 | 670 | ||
663 | static int adb_release(struct inode *inode, struct file *file) | 671 | static 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, | |||
119 | static int | 120 | static int |
120 | anslcd_open( struct inode * inode, struct file * file ) | 121 | anslcd_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 d86d57af282a..32cb0298f88e 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> |
@@ -1086,10 +1087,12 @@ static int smu_open(struct inode *inode, struct file *file) | |||
1086 | pp->mode = smu_file_commands; | 1087 | pp->mode = smu_file_commands; |
1087 | init_waitqueue_head(&pp->wait); | 1088 | init_waitqueue_head(&pp->wait); |
1088 | 1089 | ||
1090 | lock_kernel(); | ||
1089 | spin_lock_irqsave(&smu_clist_lock, flags); | 1091 | spin_lock_irqsave(&smu_clist_lock, flags); |
1090 | list_add(&pp->list, &smu_clist); | 1092 | list_add(&pp->list, &smu_clist); |
1091 | spin_unlock_irqrestore(&smu_clist_lock, flags); | 1093 | spin_unlock_irqrestore(&smu_clist_lock, flags); |
1092 | file->private_data = pp; | 1094 | file->private_data = pp; |
1095 | unlock_kernel(); | ||
1093 | 1096 | ||
1094 | return 0; | 1097 | return 0; |
1095 | } | 1098 | } |
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 | ||