[Nouveau] [PATCH 05/14] drm/nouveau/gpuobj: Do not handle gpuobj_init during fail path in gpuobj_fini

Emil Velikov emil.l.velikov at gmail.com
Sun May 20 16:14:54 PDT 2012


This approach is already handled by the subdev system. Remove
unneeded variable in the process

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 drivers/gpu/drm/nouveau/nouveau_gpuobj.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_gpuobj.c b/drivers/gpu/drm/nouveau/nouveau_gpuobj.c
index 2eed5c3..43a7cd2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gpuobj.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gpuobj.c
@@ -757,7 +757,7 @@ nouveau_gpuobj_fini(struct nouveau_device *ndev, int subdev, bool suspend)
 {
 	struct nouveau_gpuobj_priv *priv = nv_subdev(ndev, subdev);
 	struct nouveau_gpuobj *gpuobj;
-	int i, ret = 0;
+	int i;
 
 	if (suspend) {
 		list_for_each_entry(gpuobj, &priv->list, list) {
@@ -766,8 +766,7 @@ nouveau_gpuobj_fini(struct nouveau_device *ndev, int subdev, bool suspend)
 
 			gpuobj->suspend = vmalloc(gpuobj->size);
 			if (!gpuobj->suspend) {
-				ret = -ENOMEM;
-				goto error;
+				return -ENOMEM;
 			}
 
 			for (i = 0; i < gpuobj->size; i += 4)
@@ -775,16 +774,13 @@ nouveau_gpuobj_fini(struct nouveau_device *ndev, int subdev, bool suspend)
 		}
 	}
 
-error:
-	if (ret)
-		priv->base.init(ndev, subdev);
-	return ret;
+	return 0;
 }
 
 static void
 nouveau_gpuobj_destroy(struct nouveau_device *ndev, int subdev)
 {
-	struct nouveau_gpuobj_priv *priv = nv_subdev(ndev, NVDEV_SUBDEV_GPUOBJ);
+	struct nouveau_gpuobj_priv *priv = nv_subdev(ndev, subdev);
 	struct nouveau_gpuobj_method *om, *tm;
 	struct nouveau_gpuobj_class *oc, *tc;
 
-- 
1.7.10.2



More information about the Nouveau mailing list