diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-04-24 21:35:18 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-04-26 01:38:12 -0400 |
commit | 066a5d0938c64bec665866b145d8538d9f96bcda (patch) | |
tree | 1d279110415ada5e4ff79837f6621454aec1ce78 | |
parent | 9aecbada751e6343e47cbefade718e571a8ecbbc (diff) |
drm/nouveau/device: enable proper constructor/destructor
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/device/base.c | 17 |
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[] = { | |||
419 | {} | 419 | {} |
420 | }; | 420 | }; |
421 | 421 | ||
422 | static int | ||
423 | nouveau_device_fini(struct nouveau_object *object, bool suspend) | ||
424 | { | ||
425 | struct nouveau_device *device = (void *)object; | ||
426 | return nouveau_subdev_fini(&device->base, suspend); | ||
427 | } | ||
428 | |||
429 | static int | ||
430 | nouveau_device_init(struct nouveau_object *object) | ||
431 | { | ||
432 | struct nouveau_device *device = (void *)object; | ||
433 | return nouveau_subdev_init(&device->base); | ||
434 | } | ||
435 | |||
422 | static void | 436 | static void |
423 | nouveau_device_dtor(struct nouveau_object *object) | 437 | nouveau_device_dtor(struct nouveau_object *object) |
424 | { | 438 | { |
@@ -439,6 +453,8 @@ nouveau_device_oclass = { | |||
439 | .handle = NV_ENGINE(DEVICE, 0x00), | 453 | .handle = NV_ENGINE(DEVICE, 0x00), |
440 | .ofuncs = &(struct nouveau_ofuncs) { | 454 | .ofuncs = &(struct nouveau_ofuncs) { |
441 | .dtor = nouveau_device_dtor, | 455 | .dtor = nouveau_device_dtor, |
456 | .init = nouveau_device_init, | ||
457 | .fini = nouveau_device_fini, | ||
442 | }, | 458 | }, |
443 | }; | 459 | }; |
444 | 460 | ||
@@ -462,7 +478,6 @@ nouveau_device_create_(struct pci_dev *pdev, u64 name, const char *sname, | |||
462 | if (ret) | 478 | if (ret) |
463 | goto done; | 479 | goto done; |
464 | 480 | ||
465 | atomic_set(&nv_object(device)->usecount, 2); | ||
466 | device->pdev = pdev; | 481 | device->pdev = pdev; |
467 | device->handle = name; | 482 | device->handle = name; |
468 | device->cfgopt = cfg; | 483 | device->cfgopt = cfg; |