aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_irq.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-07-24 10:51:27 +1000
committerDave Airlie <airlied@linux.ie>2006-07-24 10:51:27 +1000
commit5cfbd5dbab4fe9668771377cb22da04c6103459e (patch)
tree375d460ab42628fbe57bb669d6e0710bf2fc3078 /linux-core/drm_irq.c
parent6677e2a10b820a5ccfd375cc627b8e41453a71da (diff)
switch drm to use Linux mutexes instead of semaphore.
I hope the fallback compat code works if not shout at me.
Diffstat (limited to 'linux-core/drm_irq.c')
-rw-r--r--linux-core/drm_irq.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c
index 7f21205d..d76fd51d 100644
--- a/linux-core/drm_irq.c
+++ b/linux-core/drm_irq.c
@@ -97,20 +97,20 @@ static int drm_irq_install(drm_device_t * dev)
if (dev->irq == 0)
return -EINVAL;
- down(&dev->struct_sem);
+ mutex_lock(&dev->struct_mutex);
/* Driver must have been initialized */
if (!dev->dev_private) {
- up(&dev->struct_sem);
+ mutex_unlock(&dev->struct_mutex);
return -EINVAL;
}
if (dev->irq_enabled) {
- up(&dev->struct_sem);
+ mutex_unlock(&dev->struct_mutex);
return -EBUSY;
}
dev->irq_enabled = 1;
- up(&dev->struct_sem);
+ mutex_unlock(&dev->struct_mutex);
DRM_DEBUG("%s: irq=%d\n", __FUNCTION__, dev->irq);
@@ -134,9 +134,9 @@ static int drm_irq_install(drm_device_t * dev)
ret = request_irq(dev->irq, dev->driver->irq_handler,
sh_flags, dev->devname, dev);
if (ret < 0) {
- down(&dev->struct_sem);
+ mutex_lock(&dev->struct_mutex);
dev->irq_enabled = 0;
- up(&dev->struct_sem);
+ mutex_unlock(&dev->struct_mutex);
return ret;
}
@@ -160,10 +160,10 @@ int drm_irq_uninstall(drm_device_t * dev)
if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ))
return -EINVAL;
- down(&dev->struct_sem);
+ mutex_lock(&dev->struct_mutex);
irq_enabled = dev->irq_enabled;
dev->irq_enabled = 0;
- up(&dev->struct_sem);
+ mutex_unlock(&dev->struct_mutex);
if (!irq_enabled)
return -EINVAL;