Fix drm_memory_debug.c to compile, doesn't seem to be working Clean up

error return path in drm_stub.c
main
Jon Smirl 2005-06-23 05:29:16 +00:00
parent 4152605ea1
commit 7586a655fc
2 changed files with 12 additions and 2 deletions

View File

@ -374,7 +374,11 @@ DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type)
return NULL; return NULL;
} }
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
if ((handle = drm_agp_allocate_memory(pages, type))) { if ((handle = drm_agp_allocate_memory(pages, type))) {
#else
if ((handle = drm_agp_allocate_memory(dev->agp->bridge, pages, type))) {
#endif
spin_lock(&drm_mem_lock); spin_lock(&drm_mem_lock);
++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count; ++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated
@ -387,6 +391,7 @@ DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type)
spin_unlock(&drm_mem_lock); spin_unlock(&drm_mem_lock);
return NULL; return NULL;
} }
EXPORT_SYMBOL(drm_alloc_agp);
int drm_free_agp(DRM_AGP_MEM * handle, int pages) int drm_free_agp(DRM_AGP_MEM * handle, int pages)
{ {
@ -416,6 +421,7 @@ int drm_free_agp(DRM_AGP_MEM * handle, int pages)
} }
return retval; return retval;
} }
EXPORT_SYMBOL(drm_free_agp);
int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start) int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
{ {
@ -440,6 +446,7 @@ int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
spin_unlock(&drm_mem_lock); spin_unlock(&drm_mem_lock);
return retcode; return retcode;
} }
EXPORT_SYMBOL(drm_bind_agp);
int drm_unbind_agp(DRM_AGP_MEM * handle) int drm_unbind_agp(DRM_AGP_MEM * handle)
{ {
@ -468,6 +475,7 @@ int drm_unbind_agp(DRM_AGP_MEM * handle)
} }
return retcode; return retcode;
} }
EXPORT_SYMBOL(drm_unbind_agp);
#endif #endif
#endif #endif

View File

@ -225,7 +225,6 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
pci_enable_device(pdev); pci_enable_device(pdev);
} }
if ((ret = fill_in_dev(dev, pdev, ent, driver))) { if ((ret = fill_in_dev(dev, pdev, ent, driver))) {
printk(KERN_ERR "DRM: Fill_in_dev failed.\n");
goto err_g1; goto err_g1;
} }
if ((ret = drm_get_head(dev, &dev->primary))) if ((ret = drm_get_head(dev, &dev->primary)))
@ -234,10 +233,12 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
/* postinit is a required function to display the signon banner */ /* postinit is a required function to display the signon banner */
/* drivers add secondary heads here if needed */ /* drivers add secondary heads here if needed */
if ((ret = dev->driver->postinit(dev, ent->driver_data))) if ((ret = dev->driver->postinit(dev, ent->driver_data)))
goto err_g1; goto err_g2;
return 0; return 0;
err_g2:
drm_put_head(&dev->primary);
err_g1: err_g1:
if (!drm_fb_loaded) { if (!drm_fb_loaded) {
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
@ -245,6 +246,7 @@ err_g1:
pci_disable_device(pdev); pci_disable_device(pdev);
} }
drm_free(dev, sizeof(*dev), DRM_MEM_STUB); drm_free(dev, sizeof(*dev), DRM_MEM_STUB);
printk(KERN_ERR "DRM: drm_get_dev failed.\n");
return ret; return ret;
} }
EXPORT_SYMBOL(drm_get_dev); EXPORT_SYMBOL(drm_get_dev);