diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:15 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:40:31 +1000 |
commit | 4e7e62d607a711bc8e8576a0fc7d8f242d25c9b3 (patch) | |
tree | fc62b911c58058802a8897dcf20b7eb080d57335 /drivers/gpu/drm/nouveau/nvkm/core | |
parent | 102b49da15834c1d2ba508457fdf69b3d07c6fee (diff) |
drm/nouveau/client: store default device by handle, not reference
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/core')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/core/client.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c b/drivers/gpu/drm/nouveau/nvkm/core/client.c index 5a1ddb3433de..7615cdd75294 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/client.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/client.c @@ -219,7 +219,6 @@ nvkm_client_del(struct nvkm_client **pclient) nvkm_client_fini(client, false); for (i = 0; i < ARRAY_SIZE(client->notify); i++) nvkm_client_notify_del(client, i); - nvkm_object_ref(NULL, (struct nvkm_object **)&client->device); nvkm_handle_destroy(client->root); nvkm_namedb_destroy(&client->namedb); *pclient = NULL; @@ -233,17 +232,12 @@ nvkm_client_sclass[] = { }; int -nvkm_client_new(const char *name, u64 devname, const char *cfg, +nvkm_client_new(const char *name, u64 device, const char *cfg, const char *dbg, struct nvkm_client **pclient) { - struct nvkm_device *device; struct nvkm_client *client; int ret; - device = nvkm_device_find(devname); - if (!device) - return -ENODEV; - ret = nvkm_namedb_create(NULL, NULL, &nvkm_client_oclass, NV_CLIENT_CLASS, nvkm_client_sclass, 0, &client); @@ -259,8 +253,7 @@ nvkm_client_new(const char *name, u64 devname, const char *cfg, /* prevent init/fini being called, os in in charge of this */ atomic_set(&nv_object(client)->usecount, 2); - nvkm_object_ref(&device->engine.subdev.object, - (struct nvkm_object **)&client->device); + client->device = device; snprintf(client->name, sizeof(client->name), "%s", name); client->debug = nvkm_dbgopt(dbg, "CLIENT"); return 0; |