Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19171
b: refs/heads/master
c: 1686782
h: refs/heads/master
i:
  19169: c9a44f9
  19167: 06c6e68
v: v3
  • Loading branch information
akpm@osdl.org authored and Dave Jones committed Jan 17, 2006
1 parent 2855f3d commit 2fb05e2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5dda4986752b531d89d49c218682e42c63ef1d61
refs/heads/master: 168678233ca45af3f74fef60c4265fa5dd217e29
28 changes: 14 additions & 14 deletions trunk/drivers/char/agp/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_kern_info kerninfo;

down(&(agp_fe.agp_mutex));
mutex_lock(&(agp_fe.agp_mutex));

if (agp_fe.backend_acquired != TRUE)
goto out_eperm;
Expand Down Expand Up @@ -627,7 +627,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
size, vma->vm_page_prot)) {
goto out_again;
}
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return 0;
}

Expand All @@ -643,28 +643,28 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
size, vma->vm_page_prot)) {
goto out_again;
}
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return 0;
}

out_eperm:
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return -EPERM;

out_inval:
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return -EINVAL;

out_again:
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return -EAGAIN;
}

static int agp_release(struct inode *inode, struct file *file)
{
struct agp_file_private *priv = file->private_data;

down(&(agp_fe.agp_mutex));
mutex_lock(&(agp_fe.agp_mutex));

DBG("priv=%p", priv);

Expand All @@ -687,7 +687,7 @@ static int agp_release(struct inode *inode, struct file *file)
agp_remove_file_private(priv);
kfree(priv);
file->private_data = NULL;
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return 0;
}

Expand All @@ -698,7 +698,7 @@ static int agp_open(struct inode *inode, struct file *file)
struct agp_client *client;
int rc = -ENXIO;

down(&(agp_fe.agp_mutex));
mutex_lock(&(agp_fe.agp_mutex));

if (minor != AGPGART_MINOR)
goto err_out;
Expand All @@ -723,13 +723,13 @@ static int agp_open(struct inode *inode, struct file *file)
file->private_data = (void *) priv;
agp_insert_file_private(priv);
DBG("private=%p, client=%p", priv, client);
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return 0;

err_out_nomem:
rc = -ENOMEM;
err_out:
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return rc;
}

Expand Down Expand Up @@ -985,7 +985,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,
int ret_val = -ENOTTY;

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) &&
(cmd != AGPIOC_ACQUIRE)) {
Expand Down Expand Up @@ -1055,7 +1055,7 @@ static int agp_ioctl(struct inode *inode, struct file *file,

ioctl_out:
DBG("ioctl returns %d\n", ret_val);
up(&(agp_fe.agp_mutex));
mutex_unlock(&(agp_fe.agp_mutex));
return ret_val;
}

Expand All @@ -1081,7 +1081,7 @@ static struct miscdevice agp_miscdev =
int agp_frontend_initialize(void)
{
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)) {
printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR);
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/agpgart.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ typedef struct _agp_unbind {
} agp_unbind;

#else /* __KERNEL__ */
#include <linux/mutex.h>

#define AGPGART_MINOR 175

Expand Down Expand Up @@ -201,7 +202,7 @@ struct agp_file_private {
};

struct agp_front_data {
struct semaphore agp_mutex;
struct mutex agp_mutex;
struct agp_controller *current_controller;
struct agp_controller *controllers;
struct agp_file_private *file_priv_list;
Expand Down

0 comments on commit 2fb05e2

Please sign in to comment.