X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fmacintosh%2Fsmu.c;h=290cb325a94c8b48becedab2ffe9e363aa4dd7fa;hb=2c15bd00a5d6b2b64e006e91e2196f0c6a764cb6;hp=e58c3d33e035e4cba5e5213417e08d9a6be91c2f;hpb=bc584c5107bfd97e2aa41c798e3b213bcdd4eae7;p=~andy%2Flinux diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index e58c3d33e03..290cb325a94 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -19,7 +19,6 @@ * the userland interface */ -#include #include #include #include @@ -97,6 +96,7 @@ struct smu_device { * I don't think there will ever be more than one SMU, so * for now, just hard code that */ +static DEFINE_MUTEX(smu_mutex); static struct smu_device *smu; static DEFINE_MUTEX(smu_part_access); static int smu_irq_inited; @@ -1095,12 +1095,12 @@ static int smu_open(struct inode *inode, struct file *file) pp->mode = smu_file_commands; init_waitqueue_head(&pp->wait); - lock_kernel(); + mutex_lock(&smu_mutex); spin_lock_irqsave(&smu_clist_lock, flags); list_add(&pp->list, &smu_clist); spin_unlock_irqrestore(&smu_clist_lock, flags); file->private_data = pp; - unlock_kernel(); + mutex_unlock(&smu_mutex); return 0; }