From: Marcin Slusarz Date: Tue, 12 Jan 2010 14:31:28 +0000 (+0100) Subject: nouveau: add nouveau_resource_destroy X-Git-Tag: 2.4.18~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55ba98fadfb8909d23d6f810285504abd173f0ad;p=platform%2Fupstream%2Flibdrm.git nouveau: add nouveau_resource_destroy Signed-off-by: Francisco Jerez --- diff --git a/nouveau/nouveau_resource.c b/nouveau/nouveau_resource.c index 6bef756..7acaf7d 100644 --- a/nouveau/nouveau_resource.c +++ b/nouveau/nouveau_resource.c @@ -41,6 +41,15 @@ nouveau_resource_init(struct nouveau_resource **heap, return 0; } +void +nouveau_resource_destroy(struct nouveau_resource **heap) +{ + if (!*heap) + return; + free(*heap); + *heap = NULL; +} + int nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv, struct nouveau_resource **res) diff --git a/nouveau/nouveau_resource.h b/nouveau/nouveau_resource.h index 988d246..b760dfb 100644 --- a/nouveau/nouveau_resource.h +++ b/nouveau/nouveau_resource.h @@ -38,6 +38,9 @@ int nouveau_resource_init(struct nouveau_resource **heap, unsigned start, unsigned size); +void +nouveau_resource_destroy(struct nouveau_resource **heap); + int nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv, struct nouveau_resource **);