aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_auth.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2006-02-02 03:37:46 -0500
committerDave Airlie <airlied@linux.ie>2006-02-02 03:37:46 -0500
commit30e2fb188194908e48d3f27a53ccea6740eb1e98 (patch)
treeeef1e9495aa6db6cddc67cf7f20369a3acdd2291 /drivers/char/drm/drm_auth.c
parentce60fe02fbe737cbce09e2ba5a2ef1efd20eff73 (diff)
sem2mutex: drivers/char/drm/
From: Arjan van de Ven <arjan@infradead.org> Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_auth.c')
-rw-r--r--drivers/char/drm/drm_auth.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/char/drm/drm_auth.c b/drivers/char/drm/drm_auth.c
index a47b502bc7cc..2a37586a7ee8 100644
--- a/drivers/char/drm/drm_auth.c
+++ b/drivers/char/drm/drm_auth.c
@@ -56,7 +56,7 @@ static int drm_hash_magic(drm_magic_t magic)
56 * \param magic magic number. 56 * \param magic magic number.
57 * 57 *
58 * Searches in drm_device::magiclist within all files with the same hash key 58 * Searches in drm_device::magiclist within all files with the same hash key
59 * the one with matching magic number, while holding the drm_device::struct_sem 59 * the one with matching magic number, while holding the drm_device::struct_mutex
60 * lock. 60 * lock.
61 */ 61 */
62static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic) 62static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic)
@@ -65,14 +65,14 @@ static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic)
65 drm_magic_entry_t *pt; 65 drm_magic_entry_t *pt;
66 int hash = drm_hash_magic(magic); 66 int hash = drm_hash_magic(magic);
67 67
68 down(&dev->struct_sem); 68 mutex_lock(&dev->struct_mutex);
69 for (pt = dev->magiclist[hash].head; pt; pt = pt->next) { 69 for (pt = dev->magiclist[hash].head; pt; pt = pt->next) {
70 if (pt->magic == magic) { 70 if (pt->magic == magic) {
71 retval = pt->priv; 71 retval = pt->priv;
72 break; 72 break;
73 } 73 }
74 } 74 }
75 up(&dev->struct_sem); 75 mutex_unlock(&dev->struct_mutex);
76 return retval; 76 return retval;
77} 77}
78 78
@@ -85,7 +85,7 @@ static drm_file_t *drm_find_file(drm_device_t * dev, drm_magic_t magic)
85 * 85 *
86 * Creates a drm_magic_entry structure and appends to the linked list 86 * Creates a drm_magic_entry structure and appends to the linked list
87 * associated the magic number hash key in drm_device::magiclist, while holding 87 * associated the magic number hash key in drm_device::magiclist, while holding
88 * the drm_device::struct_sem lock. 88 * the drm_device::struct_mutex lock.
89 */ 89 */
90static int drm_add_magic(drm_device_t * dev, drm_file_t * priv, 90static int drm_add_magic(drm_device_t * dev, drm_file_t * priv,
91 drm_magic_t magic) 91 drm_magic_t magic)
@@ -104,7 +104,7 @@ static int drm_add_magic(drm_device_t * dev, drm_file_t * priv,
104 entry->priv = priv; 104 entry->priv = priv;
105 entry->next = NULL; 105 entry->next = NULL;
106 106
107 down(&dev->struct_sem); 107 mutex_lock(&dev->struct_mutex);
108 if (dev->magiclist[hash].tail) { 108 if (dev->magiclist[hash].tail) {
109 dev->magiclist[hash].tail->next = entry; 109 dev->magiclist[hash].tail->next = entry;
110 dev->magiclist[hash].tail = entry; 110 dev->magiclist[hash].tail = entry;
@@ -112,7 +112,7 @@ static int drm_add_magic(drm_device_t * dev, drm_file_t * priv,
112 dev->magiclist[hash].head = entry; 112 dev->magiclist[hash].head = entry;
113 dev->magiclist[hash].tail = entry; 113 dev->magiclist[hash].tail = entry;
114 } 114 }
115 up(&dev->struct_sem); 115 mutex_unlock(&dev->struct_mutex);
116 116
117 return 0; 117 return 0;
118} 118}
@@ -124,7 +124,7 @@ static int drm_add_magic(drm_device_t * dev, drm_file_t * priv,
124 * \param magic magic number. 124 * \param magic magic number.
125 * 125 *
126 * Searches and unlinks the entry in drm_device::magiclist with the magic 126 * Searches and unlinks the entry in drm_device::magiclist with the magic
127 * number hash key, while holding the drm_device::struct_sem lock. 127 * number hash key, while holding the drm_device::struct_mutex lock.
128 */ 128 */
129static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic) 129static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic)
130{ 130{
@@ -135,7 +135,7 @@ static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic)
135 DRM_DEBUG("%d\n", magic); 135 DRM_DEBUG("%d\n", magic);
136 hash = drm_hash_magic(magic); 136 hash = drm_hash_magic(magic);
137 137
138 down(&dev->struct_sem); 138 mutex_lock(&dev->struct_mutex);
139 for (pt = dev->magiclist[hash].head; pt; prev = pt, pt = pt->next) { 139 for (pt = dev->magiclist[hash].head; pt; prev = pt, pt = pt->next) {
140 if (pt->magic == magic) { 140 if (pt->magic == magic) {
141 if (dev->magiclist[hash].head == pt) { 141 if (dev->magiclist[hash].head == pt) {
@@ -147,11 +147,11 @@ static int drm_remove_magic(drm_device_t * dev, drm_magic_t magic)
147 if (prev) { 147 if (prev) {
148 prev->next = pt->next; 148 prev->next = pt->next;
149 } 149 }
150 up(&dev->struct_sem); 150 mutex_unlock(&dev->struct_mutex);
151 return 0; 151 return 0;
152 } 152 }
153 } 153 }
154 up(&dev->struct_sem); 154 mutex_unlock(&dev->struct_mutex);
155 155
156 drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC); 156 drm_free(pt, sizeof(*pt), DRM_MEM_MAGIC);
157 157