Pekka J Enberg
2008-Mar-09 16:36 UTC
[Nouveau] [PATCH 3/4] nouveau: move nouveau_map_block() call to nouveau_addmap()
From: Pekka Enberg <penberg at cs.helsinki.fi> Move nouveau_map_block() call from nouveau_mem_alloc() to nouveau_addmap() to simplify error handling. Signed-off-by: Pekka Enberg <penberg at cs.helsinki.fi> --- shared-core/nouveau_mem.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) Index: drm/shared-core/nouveau_mem.c ==================================================================--- drm.orig/shared-core/nouveau_mem.c +++ drm/shared-core/nouveau_mem.c @@ -532,8 +532,13 @@ static int nouveau_map_block(struct drm_ static int nouveau_addmap(struct drm_device *dev, struct mem_block *block, unsigned long offset, enum drm_map_type type) { - return drm_addmap(dev, block->start, block->size, type, 0, - &block->map); + int err; + + err = drm_addmap(dev, block->start, block->size, type, 0, &block->map); + if (err) + return err; + + return nouveau_map_block(dev, block); } static int nouveau_addmap_pci(struct drm_device *dev, struct mem_block *block) @@ -646,11 +651,6 @@ alloc_ok: nouveau_mem_free_block(block); return NULL; } - - if (!nouveau_map_block(dev, block)) { - nouveau_mem_free_block(block); - return NULL; - } } DRM_DEBUG("allocated %lld bytes at 0x%llx type=0x%08x\n", block->size, block->start, block->flags);
Seemingly Similar Threads
- [PATCH 1/4] nouveau: add nouveau_addmap_{agp, fb, pci} functions
- [PATCH 2/4] nouveau: add nouveau_map_block function
- [PATCH 4/4] nouveau: clean up nouveau_mem_alloc function
- [PATCH 1/3] drm/nouveau: change channel regs mapping to ioremap
- [PATCH 1/6] drm/nouveau: bo read/write wrappers for nv04_crtc.c