| .. | .. |
|---|
| 242 | 242 | } |
|---|
| 243 | 243 | |
|---|
| 244 | 244 | void |
|---|
| 245 | | -nvif_object_fini(struct nvif_object *object) |
|---|
| 245 | +nvif_object_dtor(struct nvif_object *object) |
|---|
| 246 | 246 | { |
|---|
| 247 | 247 | struct { |
|---|
| 248 | 248 | struct nvif_ioctl_v0 ioctl; |
|---|
| .. | .. |
|---|
| 260 | 260 | } |
|---|
| 261 | 261 | |
|---|
| 262 | 262 | int |
|---|
| 263 | | -nvif_object_init(struct nvif_object *parent, u32 handle, s32 oclass, |
|---|
| 264 | | - void *data, u32 size, struct nvif_object *object) |
|---|
| 263 | +nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle, |
|---|
| 264 | + s32 oclass, void *data, u32 size, struct nvif_object *object) |
|---|
| 265 | 265 | { |
|---|
| 266 | 266 | struct { |
|---|
| 267 | 267 | struct nvif_ioctl_v0 ioctl; |
|---|
| .. | .. |
|---|
| 270 | 270 | int ret = 0; |
|---|
| 271 | 271 | |
|---|
| 272 | 272 | object->client = NULL; |
|---|
| 273 | + object->name = name ? name : "nvifObject"; |
|---|
| 273 | 274 | object->handle = handle; |
|---|
| 274 | 275 | object->oclass = oclass; |
|---|
| 275 | 276 | object->map.ptr = NULL; |
|---|
| .. | .. |
|---|
| 277 | 278 | |
|---|
| 278 | 279 | if (parent) { |
|---|
| 279 | 280 | if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) { |
|---|
| 280 | | - nvif_object_fini(object); |
|---|
| 281 | + nvif_object_dtor(object); |
|---|
| 281 | 282 | return -ENOMEM; |
|---|
| 282 | 283 | } |
|---|
| 284 | + |
|---|
| 285 | + object->parent = parent->parent; |
|---|
| 283 | 286 | |
|---|
| 284 | 287 | args->ioctl.version = 0; |
|---|
| 285 | 288 | args->ioctl.type = NVIF_IOCTL_V0_NEW; |
|---|
| .. | .. |
|---|
| 300 | 303 | } |
|---|
| 301 | 304 | |
|---|
| 302 | 305 | if (ret) |
|---|
| 303 | | - nvif_object_fini(object); |
|---|
| 306 | + nvif_object_dtor(object); |
|---|
| 304 | 307 | return ret; |
|---|
| 305 | 308 | } |
|---|