@@ -592,7 +592,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
592592 struct agp_file_private * priv = file -> private_data ;
593593 struct agp_kern_info kerninfo ;
594594
595- down (& (agp_fe .agp_mutex ));
595+ mutex_lock (& (agp_fe .agp_mutex ));
596596
597597 if (agp_fe .backend_acquired != TRUE)
598598 goto out_eperm ;
@@ -627,7 +627,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
627627 size , vma -> vm_page_prot )) {
628628 goto out_again ;
629629 }
630- up (& (agp_fe .agp_mutex ));
630+ mutex_unlock (& (agp_fe .agp_mutex ));
631631 return 0 ;
632632 }
633633
@@ -643,28 +643,28 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
643643 size , vma -> vm_page_prot )) {
644644 goto out_again ;
645645 }
646- up (& (agp_fe .agp_mutex ));
646+ mutex_unlock (& (agp_fe .agp_mutex ));
647647 return 0 ;
648648 }
649649
650650out_eperm :
651- up (& (agp_fe .agp_mutex ));
651+ mutex_unlock (& (agp_fe .agp_mutex ));
652652 return - EPERM ;
653653
654654out_inval :
655- up (& (agp_fe .agp_mutex ));
655+ mutex_unlock (& (agp_fe .agp_mutex ));
656656 return - EINVAL ;
657657
658658out_again :
659- up (& (agp_fe .agp_mutex ));
659+ mutex_unlock (& (agp_fe .agp_mutex ));
660660 return - EAGAIN ;
661661}
662662
663663static int agp_release (struct inode * inode , struct file * file )
664664{
665665 struct agp_file_private * priv = file -> private_data ;
666666
667- down (& (agp_fe .agp_mutex ));
667+ mutex_lock (& (agp_fe .agp_mutex ));
668668
669669 DBG ("priv=%p" , priv );
670670
@@ -687,7 +687,7 @@ static int agp_release(struct inode *inode, struct file *file)
687687 agp_remove_file_private (priv );
688688 kfree (priv );
689689 file -> private_data = NULL ;
690- up (& (agp_fe .agp_mutex ));
690+ mutex_unlock (& (agp_fe .agp_mutex ));
691691 return 0 ;
692692}
693693
@@ -698,7 +698,7 @@ static int agp_open(struct inode *inode, struct file *file)
698698 struct agp_client * client ;
699699 int rc = - ENXIO ;
700700
701- down (& (agp_fe .agp_mutex ));
701+ mutex_lock (& (agp_fe .agp_mutex ));
702702
703703 if (minor != AGPGART_MINOR )
704704 goto err_out ;
@@ -723,13 +723,13 @@ static int agp_open(struct inode *inode, struct file *file)
723723 file -> private_data = (void * ) priv ;
724724 agp_insert_file_private (priv );
725725 DBG ("private=%p, client=%p" , priv , client );
726- up (& (agp_fe .agp_mutex ));
726+ mutex_unlock (& (agp_fe .agp_mutex ));
727727 return 0 ;
728728
729729err_out_nomem :
730730 rc = - ENOMEM ;
731731err_out :
732- up (& (agp_fe .agp_mutex ));
732+ mutex_unlock (& (agp_fe .agp_mutex ));
733733 return rc ;
734734}
735735
@@ -985,7 +985,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
985985 int ret_val = - ENOTTY ;
986986
987987 DBG ("priv=%p, cmd=%x" , curr_priv , cmd );
988- down (& (agp_fe .agp_mutex ));
988+ mutex_lock (& (agp_fe .agp_mutex ));
989989
990990 if ((agp_fe .current_controller == NULL ) &&
991991 (cmd != AGPIOC_ACQUIRE )) {
@@ -1055,7 +1055,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
10551055
10561056ioctl_out :
10571057 DBG ("ioctl returns %d\n" , ret_val );
1058- up (& (agp_fe .agp_mutex ));
1058+ mutex_unlock (& (agp_fe .agp_mutex ));
10591059 return ret_val ;
10601060}
10611061
@@ -1081,7 +1081,7 @@ static struct miscdevice agp_miscdev =
10811081int agp_frontend_initialize (void )
10821082{
10831083 memset (& agp_fe , 0 , sizeof (struct agp_front_data ));
1084- sema_init (& (agp_fe .agp_mutex ), 1 );
1084+ mutex_init (& (agp_fe .agp_mutex ));
10851085
10861086 if (misc_register (& agp_miscdev )) {
10871087 printk (KERN_ERR PFX "unable to get minor: %d\n" , AGPGART_MINOR );
0 commit comments