device.c (9b031c86506cef9acae45e61339fcf9deaabb793) device.c (9ac596a4e875e28bb1fa4b2e00549fadfaf4784e)
1/*
2 * Copyright 2014 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 30 unchanged lines hidden (view full) ---

39}
40
41void
42nvif_device_fini(struct nvif_device *device)
43{
44 nvif_user_fini(device);
45 kfree(device->runlist);
46 device->runlist = NULL;
1/*
2 * Copyright 2014 Red Hat Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the

--- 30 unchanged lines hidden (view full) ---

39}
40
41void
42nvif_device_fini(struct nvif_device *device)
43{
44 nvif_user_fini(device);
45 kfree(device->runlist);
46 device->runlist = NULL;
47 nvif_object_fini(&device->object);
47 nvif_object_dtor(&device->object);
48}
49
50int
51nvif_device_init(struct nvif_object *parent, u32 handle, s32 oclass,
52 void *data, u32 size, struct nvif_device *device)
53{
48}
49
50int
51nvif_device_init(struct nvif_object *parent, u32 handle, s32 oclass,
52 void *data, u32 size, struct nvif_device *device)
53{
54 int ret = nvif_object_init(parent, handle, oclass, data, size,
55 &device->object);
54 int ret = nvif_object_ctor(parent, "nvifDevice", handle,
55 oclass, data, size, &device->object);
56 device->runlist = NULL;
57 device->user.func = NULL;
58 if (ret == 0) {
59 device->info.version = 0;
60 ret = nvif_object_mthd(&device->object, NV_DEVICE_V0_INFO,
61 &device->info, sizeof(device->info));
62 }
63 return ret;
64}
56 device->runlist = NULL;
57 device->user.func = NULL;
58 if (ret == 0) {
59 device->info.version = 0;
60 ret = nvif_object_mthd(&device->object, NV_DEVICE_V0_INFO,
61 &device->info, sizeof(device->info));
62 }
63 return ret;
64}