summaryrefslogtreecommitdiff
path: root/bin/nv_rifunc.h
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2015-08-20 14:54:23 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-08-28 12:37:44 +1000
commiteeeb40c6398c7a9d2b194038193d98e3d6068a2f (patch)
tree77336796ea85c47522c6c660878413f6095d59a5 /bin/nv_rifunc.h
parent3429f5fd3a2e989f7c93e86ab7c6d8381162c011 (diff)
downloadnouveau-eeeb40c6398c7a9d2b194038193d98e3d6068a2f.tar.gz
device: cleaner abstraction for device resource functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'bin/nv_rifunc.h')
-rw-r--r--bin/nv_rifunc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/nv_rifunc.h b/bin/nv_rifunc.h
index 245a4833d..8da8898ed 100644
--- a/bin/nv_rifunc.h
+++ b/bin/nv_rifunc.h
@@ -8,7 +8,7 @@ static u64 map_page = ~0ULL;
static CAST
nv_rfb(struct nvif_device *device, u64 offset)
{
- struct pci_dev *pdev = nvxx_device(device)->pdev;
+ struct nvkm_device *nv = nvxx_device(device);
u64 page = (offset & ~(PAGE_SIZE - 1));
u64 addr = (offset & (PAGE_SIZE - 1));
@@ -22,11 +22,11 @@ nv_rfb(struct nvif_device *device, u64 offset)
if (map)
iounmap(map);
- if (pci_resource_len(pdev, 2)) {
- map = ioremap(pci_resource_start(pdev, 2) +
+ if (nv->func->resource_size(nv, 2)) {
+ map = ioremap(nv->func->resource_addr(nv, 2) +
page, PAGE_SIZE);
} else {
- map = ioremap(pci_resource_start(pdev, 3) +
+ map = ioremap(nv->func->resource_addr(nv, 3) +
page, PAGE_SIZE);
}