diff options
Diffstat (limited to 'drivers/char/agp/frontend.c')
| -rw-r--r-- | drivers/char/agp/frontend.c | 28 | 
1 files changed, 14 insertions, 14 deletions
| diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c index 17f520c9d471..97eeb2345b18 100644 --- a/drivers/char/agp/frontend.c +++ b/drivers/char/agp/frontend.c | |||
| @@ -592,7 +592,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 592 | struct agp_file_private *priv = file->private_data; | 592 | struct agp_file_private *priv = file->private_data; | 
| 593 | struct agp_kern_info kerninfo; | 593 | struct agp_kern_info kerninfo; | 
| 594 | 594 | ||
| 595 | down(&(agp_fe.agp_mutex)); | 595 | mutex_lock(&(agp_fe.agp_mutex)); | 
| 596 | 596 | ||
| 597 | if (agp_fe.backend_acquired != TRUE) | 597 | if (agp_fe.backend_acquired != TRUE) | 
| 598 | goto out_eperm; | 598 | goto out_eperm; | 
| @@ -627,7 +627,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 627 | size, vma->vm_page_prot)) { | 627 | size, vma->vm_page_prot)) { | 
| 628 | goto out_again; | 628 | goto out_again; | 
| 629 | } | 629 | } | 
| 630 | up(&(agp_fe.agp_mutex)); | 630 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 631 | return 0; | 631 | return 0; | 
| 632 | } | 632 | } | 
| 633 | 633 | ||
| @@ -643,20 +643,20 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma) | |||
| 643 | size, vma->vm_page_prot)) { | 643 | size, vma->vm_page_prot)) { | 
| 644 | goto out_again; | 644 | goto out_again; | 
| 645 | } | 645 | } | 
| 646 | up(&(agp_fe.agp_mutex)); | 646 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 647 | return 0; | 647 | return 0; | 
| 648 | } | 648 | } | 
| 649 | 649 | ||
| 650 | out_eperm: | 650 | out_eperm: | 
| 651 | up(&(agp_fe.agp_mutex)); | 651 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 652 | return -EPERM; | 652 | return -EPERM; | 
| 653 | 653 | ||
| 654 | out_inval: | 654 | out_inval: | 
| 655 | up(&(agp_fe.agp_mutex)); | 655 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 656 | return -EINVAL; | 656 | return -EINVAL; | 
| 657 | 657 | ||
| 658 | out_again: | 658 | out_again: | 
| 659 | up(&(agp_fe.agp_mutex)); | 659 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 660 | return -EAGAIN; | 660 | return -EAGAIN; | 
| 661 | } | 661 | } | 
| 662 | 662 | ||
| @@ -664,7 +664,7 @@ static int agp_release(struct inode *inode, struct file *file) | |||
| 664 | { | 664 | { | 
| 665 | struct agp_file_private *priv = file->private_data; | 665 | struct agp_file_private *priv = file->private_data; | 
| 666 | 666 | ||
| 667 | down(&(agp_fe.agp_mutex)); | 667 | mutex_lock(&(agp_fe.agp_mutex)); | 
| 668 | 668 | ||
| 669 | DBG("priv=%p", priv); | 669 | DBG("priv=%p", priv); | 
| 670 | 670 | ||
| @@ -687,7 +687,7 @@ static int agp_release(struct inode *inode, struct file *file) | |||
| 687 | agp_remove_file_private(priv); | 687 | agp_remove_file_private(priv); | 
| 688 | kfree(priv); | 688 | kfree(priv); | 
| 689 | file->private_data = NULL; | 689 | file->private_data = NULL; | 
| 690 | up(&(agp_fe.agp_mutex)); | 690 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 691 | return 0; | 691 | return 0; | 
| 692 | } | 692 | } | 
| 693 | 693 | ||
| @@ -698,7 +698,7 @@ static int agp_open(struct inode *inode, struct file *file) | |||
| 698 | struct agp_client *client; | 698 | struct agp_client *client; | 
| 699 | int rc = -ENXIO; | 699 | int rc = -ENXIO; | 
| 700 | 700 | ||
| 701 | down(&(agp_fe.agp_mutex)); | 701 | mutex_lock(&(agp_fe.agp_mutex)); | 
| 702 | 702 | ||
| 703 | if (minor != AGPGART_MINOR) | 703 | if (minor != AGPGART_MINOR) | 
| 704 | goto err_out; | 704 | goto err_out; | 
| @@ -723,13 +723,13 @@ static int agp_open(struct inode *inode, struct file *file) | |||
| 723 | file->private_data = (void *) priv; | 723 | file->private_data = (void *) priv; | 
| 724 | agp_insert_file_private(priv); | 724 | agp_insert_file_private(priv); | 
| 725 | DBG("private=%p, client=%p", priv, client); | 725 | DBG("private=%p, client=%p", priv, client); | 
| 726 | up(&(agp_fe.agp_mutex)); | 726 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 727 | return 0; | 727 | return 0; | 
| 728 | 728 | ||
| 729 | err_out_nomem: | 729 | err_out_nomem: | 
| 730 | rc = -ENOMEM; | 730 | rc = -ENOMEM; | 
| 731 | err_out: | 731 | err_out: | 
| 732 | up(&(agp_fe.agp_mutex)); | 732 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 733 | return rc; | 733 | return rc; | 
| 734 | } | 734 | } | 
| 735 | 735 | ||
| @@ -985,7 +985,7 @@ static int agp_ioctl(struct inode *inode, struct file *file, | |||
| 985 | int ret_val = -ENOTTY; | 985 | int ret_val = -ENOTTY; | 
| 986 | 986 | ||
| 987 | DBG("priv=%p, cmd=%x", curr_priv, cmd); | 987 | DBG("priv=%p, cmd=%x", curr_priv, cmd); | 
| 988 | down(&(agp_fe.agp_mutex)); | 988 | mutex_lock(&(agp_fe.agp_mutex)); | 
| 989 | 989 | ||
| 990 | if ((agp_fe.current_controller == NULL) && | 990 | if ((agp_fe.current_controller == NULL) && | 
| 991 | (cmd != AGPIOC_ACQUIRE)) { | 991 | (cmd != AGPIOC_ACQUIRE)) { | 
| @@ -1055,7 +1055,7 @@ static int agp_ioctl(struct inode *inode, struct file *file, | |||
| 1055 | 1055 | ||
| 1056 | ioctl_out: | 1056 | ioctl_out: | 
| 1057 | DBG("ioctl returns %d\n", ret_val); | 1057 | DBG("ioctl returns %d\n", ret_val); | 
| 1058 | up(&(agp_fe.agp_mutex)); | 1058 | mutex_unlock(&(agp_fe.agp_mutex)); | 
| 1059 | return ret_val; | 1059 | return ret_val; | 
| 1060 | } | 1060 | } | 
| 1061 | 1061 | ||
| @@ -1081,7 +1081,7 @@ static struct miscdevice agp_miscdev = | |||
| 1081 | int agp_frontend_initialize(void) | 1081 | int agp_frontend_initialize(void) | 
| 1082 | { | 1082 | { | 
| 1083 | memset(&agp_fe, 0, sizeof(struct agp_front_data)); | 1083 | memset(&agp_fe, 0, sizeof(struct agp_front_data)); | 
| 1084 | sema_init(&(agp_fe.agp_mutex), 1); | 1084 | mutex_init(&(agp_fe.agp_mutex)); | 
| 1085 | 1085 | ||
| 1086 | if (misc_register(&agp_miscdev)) { | 1086 | if (misc_register(&agp_miscdev)) { | 
| 1087 | printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR); | 1087 | printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR); | 
