summaryrefslogtreecommitdiff
path: root/bsd-core/drm_drv.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2003-11-12 20:30:51 +0000
committerEric Anholt <anholt@freebsd.org>2003-11-12 20:30:51 +0000
commit6e56c39371a551af1e05e53231162e0fc42c6ce0 (patch)
tree208ddc8abb26093a9da37732eaf903649e4971b0 /bsd-core/drm_drv.c
parent1f7598245af7e73b34130a44fbaac230e29d7aad (diff)
Fix a locking nit, and add asserts in some things that should be called
with locks held.
Diffstat (limited to 'bsd-core/drm_drv.c')
-rw-r--r--bsd-core/drm_drv.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c
index 1083f9f9..bf1e2ac4 100644
--- a/bsd-core/drm_drv.c
+++ b/bsd-core/drm_drv.c
@@ -417,11 +417,13 @@ const char *DRM(find_description)(int vendor, int device) {
return NULL;
}
-/* Initialize the DRM on first open. Called with device's lock held */
+/* Initialize the DRM on first open. */
static int DRM(setup)( drm_device_t *dev )
{
int i;
+ DRM_SPINLOCK_ASSERT(&dev->dev_lock);
+
DRIVER_PRESETUP();
dev->buf_use = 0;
@@ -496,9 +498,7 @@ static int DRM(setup)( drm_device_t *dev )
return 0;
}
-/* Free resources associated with the DRM on the last close.
- * Called with the device's lock held.
- */
+/* Free resources associated with the DRM on the last close. */
static int DRM(takedown)( drm_device_t *dev )
{
drm_magic_entry_t *pt, *next;
@@ -506,6 +506,8 @@ static int DRM(takedown)( drm_device_t *dev )
drm_map_list_entry_t *list;
int i;
+ DRM_SPINLOCK_ASSERT(&dev->dev_lock);
+
DRM_DEBUG( "\n" );
DRIVER_PRETAKEDOWN();