X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fmacintosh%2Fsmu.c;h=d409f67594828e5501e754edc1fb60e5337b2f3d;hp=135f22eb1ad4bc8500ddc7a38c3023cac882ed52;hb=721e2629fa2167c0e5a9f10d704b1fee1621a8cb;hpb=445c9b5507b9d09a2e9b0b4dbb16517708aa40e6 diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 135f22eb1ad4..d409f6759482 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -606,7 +606,7 @@ static void smu_expose_childs(struct work_struct *unused) struct device_node *np; for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) - if (device_is_compatible(np, "smu-sensors")) + if (of_device_is_compatible(np, "smu-sensors")) of_platform_device_create(np, "smu-sensors", &smu->of_dev->dev); } @@ -1053,10 +1053,9 @@ static int smu_open(struct inode *inode, struct file *file) struct smu_private *pp; unsigned long flags; - pp = kmalloc(sizeof(struct smu_private), GFP_KERNEL); + pp = kzalloc(sizeof(struct smu_private), GFP_KERNEL); if (pp == 0) return -ENOMEM; - memset(pp, 0, sizeof(struct smu_private)); spin_lock_init(&pp->lock); pp->mode = smu_file_commands; init_waitqueue_head(&pp->wait); @@ -1259,9 +1258,9 @@ static int smu_release(struct inode *inode, struct file *file) set_current_state(TASK_UNINTERRUPTIBLE); if (pp->cmd.status != 1) break; - spin_lock_irqsave(&pp->lock, flags); - schedule(); spin_unlock_irqrestore(&pp->lock, flags); + schedule(); + spin_lock_irqsave(&pp->lock, flags); } set_current_state(TASK_RUNNING); remove_wait_queue(&pp->wait, &wait);