drm/nv50-/fb: use dma_mapping_error() to check dma_map_page() result
authorBen Skeggs <bskeggs@redhat.com>
Tue, 5 Aug 2014 12:03:49 +0000 (22:03 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Sat, 9 Aug 2014 19:12:52 +0000 (05:12 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c

index 7d88e17fa9271d030894f519bc9ea4773929468e..4150b0d10af8a6ec5ac9b022ff5534fc101cac20 100644 (file)
@@ -253,8 +253,8 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
                priv->r100c08 = dma_map_page(nv_device_base(device),
                                             priv->r100c08_page, 0, PAGE_SIZE,
                                             DMA_BIDIRECTIONAL);
-               if (!priv->r100c08)
-                       nv_warn(priv, "failed 0x100c08 page map\n");
+               if (dma_mapping_error(nv_device_base(device), priv->r100c08))
+                       return -EFAULT;
        } else {
                nv_warn(priv, "failed 0x100c08 page alloc\n");
        }
index 9f5f3ac8d4c6e9dfb350289e72c92a3a3fd3bc79..b19a2b3c10813fb9327e415f1985afc76d8c65ee 100644 (file)
@@ -97,7 +97,7 @@ nvc0_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
                priv->r100c10 = dma_map_page(nv_device_base(device),
                                             priv->r100c10_page, 0, PAGE_SIZE,
                                             DMA_BIDIRECTIONAL);
-               if (!priv->r100c10)
+               if (dma_mapping_error(nv_device_base(device), priv->r100c10))
                        return -EFAULT;
        }