aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/frontend.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/frontend.c')
-rw-r--r--drivers/char/agp/frontend.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
index 857b26227d87..a96f3197e60f 100644
--- a/drivers/char/agp/frontend.c
+++ b/drivers/char/agp/frontend.c
@@ -39,6 +39,7 @@
39#include <linux/mm.h> 39#include <linux/mm.h>
40#include <linux/fs.h> 40#include <linux/fs.h>
41#include <linux/sched.h> 41#include <linux/sched.h>
42#include <linux/smp_lock.h>
42#include <asm/uaccess.h> 43#include <asm/uaccess.h>
43#include <asm/pgtable.h> 44#include <asm/pgtable.h>
44#include "agp.h" 45#include "agp.h"
@@ -395,7 +396,7 @@ static int agp_remove_controller(struct agp_controller *controller)
395 396
396 if (agp_fe.current_controller == controller) { 397 if (agp_fe.current_controller == controller) {
397 agp_fe.current_controller = NULL; 398 agp_fe.current_controller = NULL;
398 agp_fe.backend_acquired = FALSE; 399 agp_fe.backend_acquired = false;
399 agp_backend_release(agp_bridge); 400 agp_backend_release(agp_bridge);
400 } 401 }
401 kfree(controller); 402 kfree(controller);
@@ -443,7 +444,7 @@ static void agp_controller_release_current(struct agp_controller *controller,
443 } 444 }
444 445
445 agp_fe.current_controller = NULL; 446 agp_fe.current_controller = NULL;
446 agp_fe.used_by_controller = FALSE; 447 agp_fe.used_by_controller = false;
447 agp_backend_release(agp_bridge); 448 agp_backend_release(agp_bridge);
448} 449}
449 450
@@ -573,7 +574,7 @@ static int agp_mmap(struct file *file, struct vm_area_struct *vma)
573 574
574 mutex_lock(&(agp_fe.agp_mutex)); 575 mutex_lock(&(agp_fe.agp_mutex));
575 576
576 if (agp_fe.backend_acquired != TRUE) 577 if (agp_fe.backend_acquired != true)
577 goto out_eperm; 578 goto out_eperm;
578 579
579 if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags))) 580 if (!(test_bit(AGP_FF_IS_VALID, &priv->access_flags)))
@@ -677,6 +678,7 @@ static int agp_open(struct inode *inode, struct file *file)
677 struct agp_client *client; 678 struct agp_client *client;
678 int rc = -ENXIO; 679 int rc = -ENXIO;
679 680
681 lock_kernel();
680 mutex_lock(&(agp_fe.agp_mutex)); 682 mutex_lock(&(agp_fe.agp_mutex));
681 683
682 if (minor != AGPGART_MINOR) 684 if (minor != AGPGART_MINOR)
@@ -703,12 +705,14 @@ static int agp_open(struct inode *inode, struct file *file)
703 agp_insert_file_private(priv); 705 agp_insert_file_private(priv);
704 DBG("private=%p, client=%p", priv, client); 706 DBG("private=%p, client=%p", priv, client);
705 mutex_unlock(&(agp_fe.agp_mutex)); 707 mutex_unlock(&(agp_fe.agp_mutex));
708 unlock_kernel();
706 return 0; 709 return 0;
707 710
708err_out_nomem: 711err_out_nomem:
709 rc = -ENOMEM; 712 rc = -ENOMEM;
710err_out: 713err_out:
711 mutex_unlock(&(agp_fe.agp_mutex)); 714 mutex_unlock(&(agp_fe.agp_mutex));
715 unlock_kernel();
712 return rc; 716 return rc;
713} 717}
714 718
@@ -768,7 +772,7 @@ int agpioc_acquire_wrap(struct agp_file_private *priv)
768 772
769 atomic_inc(&agp_bridge->agp_in_use); 773 atomic_inc(&agp_bridge->agp_in_use);
770 774
771 agp_fe.backend_acquired = TRUE; 775 agp_fe.backend_acquired = true;
772 776
773 controller = agp_find_controller_by_pid(priv->my_pid); 777 controller = agp_find_controller_by_pid(priv->my_pid);
774 778
@@ -778,7 +782,7 @@ int agpioc_acquire_wrap(struct agp_file_private *priv)
778 controller = agp_create_controller(priv->my_pid); 782 controller = agp_create_controller(priv->my_pid);
779 783
780 if (controller == NULL) { 784 if (controller == NULL) {
781 agp_fe.backend_acquired = FALSE; 785 agp_fe.backend_acquired = false;
782 agp_backend_release(agp_bridge); 786 agp_backend_release(agp_bridge);
783 return -ENOMEM; 787 return -ENOMEM;
784 } 788 }
@@ -981,7 +985,7 @@ static long agp_ioctl(struct file *file,
981 ret_val = -EINVAL; 985 ret_val = -EINVAL;
982 goto ioctl_out; 986 goto ioctl_out;
983 } 987 }
984 if ((agp_fe.backend_acquired != TRUE) && 988 if ((agp_fe.backend_acquired != true) &&
985 (cmd != AGPIOC_ACQUIRE)) { 989 (cmd != AGPIOC_ACQUIRE)) {
986 ret_val = -EBUSY; 990 ret_val = -EBUSY;
987 goto ioctl_out; 991 goto ioctl_out;