summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-08-05 22:03:49 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-08-10 04:43:21 +1000
commit6ab73d0a1792592863ea6a12890337d49e4d772c (patch)
treef04fdf154873cdd555c1a518485fb1e541721520
parent54eb8ce4902b21dbbaa6f28e9c8392bd328467f9 (diff)
downloadnouveau-6ab73d0a1792592863ea6a12890337d49e4d772c.tar.gz
fb/nv50-: use dma_mapping_error() to check dma_map_page() result
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--nvkm/subdev/fb/nv50.c4
-rw-r--r--nvkm/subdev/fb/nvc0.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/nvkm/subdev/fb/nv50.c b/nvkm/subdev/fb/nv50.c
index 7d88e17fa..4150b0d10 100644
--- a/nvkm/subdev/fb/nv50.c
+++ b/nvkm/subdev/fb/nv50.c
@@ -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");
}
diff --git a/nvkm/subdev/fb/nvc0.c b/nvkm/subdev/fb/nvc0.c
index 9f5f3ac8d..b19a2b3c1 100644
--- a/nvkm/subdev/fb/nvc0.c
+++ b/nvkm/subdev/fb/nvc0.c
@@ -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;
}