summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-04-25 11:35:18 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-04-26 15:38:12 +1000
commit066a5d0938c64bec665866b145d8538d9f96bcda (patch)
tree1d279110415ada5e4ff79837f6621454aec1ce78 /drivers/gpu/drm/nouveau
parent9aecbada751e6343e47cbefade718e571a8ecbbc (diff)
downloadblackbird-op-linux-066a5d0938c64bec665866b145d8538d9f96bcda.tar.gz
blackbird-op-linux-066a5d0938c64bec665866b145d8538d9f96bcda.zip
drm/nouveau/device: enable proper constructor/destructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/device/base.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/device/base.c b/drivers/gpu/drm/nouveau/core/engine/device/base.c
index 30723ee8114c..497d5f60a195 100644
--- a/drivers/gpu/drm/nouveau/core/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/core/engine/device/base.c
@@ -419,6 +419,20 @@ nouveau_device_sclass[] = {
{}
};
+static int
+nouveau_device_fini(struct nouveau_object *object, bool suspend)
+{
+ struct nouveau_device *device = (void *)object;
+ return nouveau_subdev_fini(&device->base, suspend);
+}
+
+static int
+nouveau_device_init(struct nouveau_object *object)
+{
+ struct nouveau_device *device = (void *)object;
+ return nouveau_subdev_init(&device->base);
+}
+
static void
nouveau_device_dtor(struct nouveau_object *object)
{
@@ -439,6 +453,8 @@ nouveau_device_oclass = {
.handle = NV_ENGINE(DEVICE, 0x00),
.ofuncs = &(struct nouveau_ofuncs) {
.dtor = nouveau_device_dtor,
+ .init = nouveau_device_init,
+ .fini = nouveau_device_fini,
},
};
@@ -462,7 +478,6 @@ nouveau_device_create_(struct pci_dev *pdev, u64 name, const char *sname,
if (ret)
goto done;
- atomic_set(&nv_object(device)->usecount, 2);
device->pdev = pdev;
device->handle = name;
device->cfgopt = cfg;
OpenPOWER on IntegriCloud