|
@@ -592,7 +592,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
|
|
struct agp_file_private *priv = file->private_data;
|
|
struct agp_file_private *priv = file->private_data;
|
|
struct agp_kern_info kerninfo;
|
|
struct agp_kern_info kerninfo;
|
|
|
|
|
|
- down(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_lock(&(agp_fe.agp_mutex));
|
|
|
|
|
|
if (agp_fe.backend_acquired != TRUE)
|
|
if (agp_fe.backend_acquired != TRUE)
|
|
goto out_eperm;
|
|
goto out_eperm;
|
|
@@ -627,7 +627,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
|
|
size, vma->vm_page_prot)) {
|
|
size, vma->vm_page_prot)) {
|
|
goto out_again;
|
|
goto out_again;
|
|
}
|
|
}
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -643,20 +643,20 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
|
|
size, vma->vm_page_prot)) {
|
|
size, vma->vm_page_prot)) {
|
|
goto out_again;
|
|
goto out_again;
|
|
}
|
|
}
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
out_eperm:
|
|
out_eperm:
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
|
|
|
out_inval:
|
|
out_inval:
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
out_again:
|
|
out_again:
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return -EAGAIN;
|
|
return -EAGAIN;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -664,7 +664,7 @@ static int agp_release(struct inode *inode, struct file *file)
|
|
{
|
|
{
|
|
struct agp_file_private *priv = file->private_data;
|
|
struct agp_file_private *priv = file->private_data;
|
|
|
|
|
|
- down(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_lock(&(agp_fe.agp_mutex));
|
|
|
|
|
|
DBG("priv=%p", priv);
|
|
DBG("priv=%p", priv);
|
|
|
|
|
|
@@ -687,7 +687,7 @@ static int agp_release(struct inode *inode, struct file *file)
|
|
agp_remove_file_private(priv);
|
|
agp_remove_file_private(priv);
|
|
kfree(priv);
|
|
kfree(priv);
|
|
file->private_data = NULL;
|
|
file->private_data = NULL;
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -698,7 +698,7 @@ static int agp_open(struct inode *inode, struct file *file)
|
|
struct agp_client *client;
|
|
struct agp_client *client;
|
|
int rc = -ENXIO;
|
|
int rc = -ENXIO;
|
|
|
|
|
|
- down(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_lock(&(agp_fe.agp_mutex));
|
|
|
|
|
|
if (minor != AGPGART_MINOR)
|
|
if (minor != AGPGART_MINOR)
|
|
goto err_out;
|
|
goto err_out;
|
|
@@ -723,13 +723,13 @@ static int agp_open(struct inode *inode, struct file *file)
|
|
file->private_data = (void *) priv;
|
|
file->private_data = (void *) priv;
|
|
agp_insert_file_private(priv);
|
|
agp_insert_file_private(priv);
|
|
DBG("private=%p, client=%p", priv, client);
|
|
DBG("private=%p, client=%p", priv, client);
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
err_out_nomem:
|
|
err_out_nomem:
|
|
rc = -ENOMEM;
|
|
rc = -ENOMEM;
|
|
err_out:
|
|
err_out:
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -985,7 +985,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
|
|
int ret_val = -ENOTTY;
|
|
int ret_val = -ENOTTY;
|
|
|
|
|
|
DBG("priv=%p, cmd=%x", curr_priv, cmd);
|
|
DBG("priv=%p, cmd=%x", curr_priv, cmd);
|
|
- down(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_lock(&(agp_fe.agp_mutex));
|
|
|
|
|
|
if ((agp_fe.current_controller == NULL) &&
|
|
if ((agp_fe.current_controller == NULL) &&
|
|
(cmd != AGPIOC_ACQUIRE)) {
|
|
(cmd != AGPIOC_ACQUIRE)) {
|
|
@@ -1055,7 +1055,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
|
|
|
|
|
|
ioctl_out:
|
|
ioctl_out:
|
|
DBG("ioctl returns %d\n", ret_val);
|
|
DBG("ioctl returns %d\n", ret_val);
|
|
- up(&(agp_fe.agp_mutex));
|
|
|
|
|
|
+ mutex_unlock(&(agp_fe.agp_mutex));
|
|
return ret_val;
|
|
return ret_val;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1081,7 +1081,7 @@ static struct miscdevice agp_miscdev =
|
|
int agp_frontend_initialize(void)
|
|
int agp_frontend_initialize(void)
|
|
{
|
|
{
|
|
memset(&agp_fe, 0, sizeof(struct agp_front_data));
|
|
memset(&agp_fe, 0, sizeof(struct agp_front_data));
|
|
- sema_init(&(agp_fe.agp_mutex), 1);
|
|
|
|
|
|
+ mutex_init(&(agp_fe.agp_mutex));
|
|
|
|
|
|
if (misc_register(&agp_miscdev)) {
|
|
if (misc_register(&agp_miscdev)) {
|
|
printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR);
|
|
printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR);
|