summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2007-12-01 02:32:23 -0500
committerRobert Noland <rnoland@2hip.net>2007-12-01 02:32:23 -0500
commit83e62be6f449ad480eb590ee9d4131974c9920e2 (patch)
treec08118eefa85e19b0350218632c48df02d548ec7
parent887b920a7fd2cfa70b41425d26e4d3707d4075b9 (diff)
bsd: Move counter initialization to load time.
-rw-r--r--bsd-core/drm_drv.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c
index d6868b9c..2e976107 100644
--- a/bsd-core/drm_drv.c
+++ b/bsd-core/drm_drv.c
@@ -403,17 +403,6 @@ static int drm_firstopen(drm_device_t *dev)
return i;
}
- dev->counters = 6;
- dev->types[0] = _DRM_STAT_LOCK;
- dev->types[1] = _DRM_STAT_OPENS;
- dev->types[2] = _DRM_STAT_CLOSES;
- dev->types[3] = _DRM_STAT_IOCTLS;
- dev->types[4] = _DRM_STAT_LOCKS;
- dev->types[5] = _DRM_STAT_UNLOCKS;
-
- for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
- atomic_set( &dev->counts[i], 0 );
-
for ( i = 0 ; i < DRM_HASH_SIZE ; i++ ) {
dev->magiclist[i].head = NULL;
dev->magiclist[i].tail = NULL;
@@ -511,7 +500,7 @@ static int drm_lastclose(drm_device_t *dev)
static int drm_load(drm_device_t *dev)
{
- int retcode;
+ int i, retcode;
DRM_DEBUG( "\n" );
@@ -536,6 +525,17 @@ static int drm_load(drm_device_t *dev)
#endif
TAILQ_INIT(&dev->files);
+ dev->counters = 6;
+ dev->types[0] = _DRM_STAT_LOCK;
+ dev->types[1] = _DRM_STAT_OPENS;
+ dev->types[2] = _DRM_STAT_CLOSES;
+ dev->types[3] = _DRM_STAT_IOCTLS;
+ dev->types[4] = _DRM_STAT_LOCKS;
+ dev->types[5] = _DRM_STAT_UNLOCKS;
+
+ for ( i = 0 ; i < DRM_ARRAY_SIZE(dev->counts) ; i++ )
+ atomic_set( &dev->counts[i], 0 );
+
if (dev->driver.load != NULL) {
DRM_LOCK();
/* Shared code returns -errno. */