]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/drm/drm_stub.c
drm: detypedeffing continues...
[linux-2.6-omap-h63xx.git] / drivers / char / drm / drm_stub.c
index 120d10256feb6d5371da2d3c9652f8e26ce73aa4..9138b49e676e94013f93d5cafa11e074798d7168 100644 (file)
@@ -49,19 +49,25 @@ MODULE_PARM_DESC(debug, "Enable debug output");
 module_param_named(cards_limit, drm_cards_limit, int, 0444);
 module_param_named(debug, drm_debug, int, 0600);
 
-drm_head_t **drm_heads;
+struct drm_head **drm_heads;
 struct class *drm_class;
 struct proc_dir_entry *drm_proc_root;
 
-static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
+static int drm_fill_in_dev(struct drm_device * dev, struct pci_dev *pdev,
                           const struct pci_device_id *ent,
                           struct drm_driver *driver)
 {
        int retcode;
 
+       INIT_LIST_HEAD(&dev->filelist);
+       INIT_LIST_HEAD(&dev->ctxlist);
+       INIT_LIST_HEAD(&dev->vmalist);
+       INIT_LIST_HEAD(&dev->maplist);
+
        spin_lock_init(&dev->count_lock);
        spin_lock_init(&dev->drw_lock);
        spin_lock_init(&dev->tasklet_lock);
+       spin_lock_init(&dev->lock.spinlock);
        init_timer(&dev->timer);
        mutex_init(&dev->struct_mutex);
        mutex_init(&dev->ctxlist_mutex);
@@ -75,12 +81,7 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
 #endif
        dev->irq = pdev->irq;
 
-       dev->maplist = drm_calloc(1, sizeof(*dev->maplist), DRM_MEM_MAPS);
-       if (dev->maplist == NULL)
-               return -ENOMEM;
-       INIT_LIST_HEAD(&dev->maplist->head);
        if (drm_ht_create(&dev->map_hash, 12)) {
-               drm_free(dev->maplist, sizeof(*dev->maplist), DRM_MEM_MAPS);
                return -ENOMEM;
        }
 
@@ -142,9 +143,9 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
  * create the proc init entry via proc_init(). This routines assigns
  * minor numbers to secondary heads of multi-headed cards
  */
-static int drm_get_head(drm_device_t * dev, drm_head_t * head)
+static int drm_get_head(struct drm_device * dev, struct drm_head * head)
 {
-       drm_head_t **heads = drm_heads;
+       struct drm_head **heads = drm_heads;
        int ret;
        int minor;
 
@@ -153,7 +154,7 @@ static int drm_get_head(drm_device_t * dev, drm_head_t * head)
        for (minor = 0; minor < drm_cards_limit; minor++, heads++) {
                if (!*heads) {
 
-                       *head = (drm_head_t) {
+                       *head = (struct drm_head) {
                        .dev = dev,.device =
                                    MKDEV(DRM_MAJOR, minor),.minor = minor,};
 
@@ -183,7 +184,7 @@ static int drm_get_head(drm_device_t * dev, drm_head_t * head)
       err_g2:
        drm_proc_cleanup(minor, drm_proc_root, head->dev_root);
       err_g1:
-       *head = (drm_head_t) {
+       *head = (struct drm_head) {
        .dev = NULL};
        return ret;
 }
@@ -202,7 +203,7 @@ static int drm_get_head(drm_device_t * dev, drm_head_t * head)
 int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
                struct drm_driver *driver)
 {
-       drm_device_t *dev;
+       struct drm_device *dev;
        int ret;
 
        DRM_DEBUG("\n");
@@ -245,7 +246,7 @@ err_g1:
  * "drm" data, otherwise unregisters the "drm" data, frees the dev list and
  * unregisters the character device.
  */
-int drm_put_dev(drm_device_t * dev)
+int drm_put_dev(struct drm_device * dev)
 {
        DRM_DEBUG("release primary %s\n", dev->driver->pci_driver.name);
 
@@ -273,7 +274,7 @@ int drm_put_dev(drm_device_t * dev)
  * last minor released.
  *
  */
-int drm_put_head(drm_head_t * head)
+int drm_put_head(struct drm_head * head)
 {
        int minor = head->minor;
 
@@ -282,7 +283,7 @@ int drm_put_head(drm_head_t * head)
        drm_proc_cleanup(minor, drm_proc_root, head->dev_root);
        drm_sysfs_device_remove(head->dev_class);
 
-       *head = (drm_head_t) {.dev = NULL};
+       *head = (struct drm_head) {.dev = NULL};
 
        drm_heads[minor] = NULL;