[Nouveau] [PATCH 06/14] drm/nouveau/instmem: Do not handle instmem_init during fail path in instmem_fini

Emil Velikov emil.l.velikov at gmail.com
Sun May 20 16:14:55 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/nv50_instmem.c |   10 +++-------
 drivers/gpu/drm/nouveau/nvc0_instmem.c |   10 +++-------
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c
index f954e87..79e78d0 100644
--- a/drivers/gpu/drm/nouveau/nv50_instmem.c
+++ b/drivers/gpu/drm/nouveau/nv50_instmem.c
@@ -201,7 +201,7 @@ static int
 nv50_instmem_init(struct nouveau_device *ndev, int subdev)
 {
 	struct nv50_instmem_priv *priv = nv_subdev(ndev, subdev);
-	int ret = 0, i;
+	int i;
 
 	nv_wr32(ndev, 0x001700, priv->mem->offset >> 16);
 
@@ -224,15 +224,11 @@ nv50_instmem_init(struct nouveau_device *ndev, int subdev)
 	for (i = 0; i < 64 * 1024; i += 4) {
 		if (nv_rd32(ndev, 0x705000 + i) != nv_ri32(ndev, i)) {
 			NV_ERROR(ndev, "INSTMEM: readback failed\n");
-			ret = -EIO;
-			goto error;
+			return -EIO;
 		}
 	}
 
-error:
-	if (ret)
-		priv->base.base.fini(ndev, subdev, false);
-	return ret;
+	return 0;
 }
 
 int
diff --git a/drivers/gpu/drm/nouveau/nvc0_instmem.c b/drivers/gpu/drm/nouveau/nvc0_instmem.c
index 2df078b..59e28f7 100644
--- a/drivers/gpu/drm/nouveau/nvc0_instmem.c
+++ b/drivers/gpu/drm/nouveau/nvc0_instmem.c
@@ -107,7 +107,7 @@ static int
 nvc0_instmem_init(struct nouveau_device *ndev, int subdev)
 {
 	struct nvc0_instmem_priv *priv = nv_subdev(ndev, subdev);
-	int ret = 0, i;
+	int i;
 
 	nv_wr32(ndev, 0x001700, priv->mem->offset >> 16);
 
@@ -128,15 +128,11 @@ nvc0_instmem_init(struct nouveau_device *ndev, int subdev)
 	for (i = 0; i < 64 * 1024; i += 4) {
 		if (nv_rd32(ndev, 0x702000 + i) != nv_ri32(ndev, i)) {
 			NV_ERROR(ndev, "INSTMEM: readback failed\n");
-			ret = -EIO;
-			goto error;
+			return -EIO;
 		}
 	}
 
-error:
-	if (ret)
-		priv->base.base.fini(ndev, subdev, false);
-	return ret;
+	return 0;
 }
 
 int
-- 
1.7.10.2



More information about the Nouveau mailing list