From 6e56c39371a551af1e05e53231162e0fc42c6ce0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Nov 2003 20:30:51 +0000 Subject: Fix a locking nit, and add asserts in some things that should be called with locks held. --- bsd/drm_drv.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bsd/drm_drv.h') diff --git a/bsd/drm_drv.h b/bsd/drm_drv.h index 1083f9f9..bf1e2ac4 100644 --- a/bsd/drm_drv.h +++ b/bsd/drm_drv.h @@ -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(); -- cgit v1.2.3