static int nv50_disp_chan_child_new(const struct nvkm_oclass *oclass, void *argv, u32 argc, struct nvkm_object **pobject) { struct nv50_disp_chan *chan = nv50_disp_chan(oclass->parent); struct nv50_disp *disp = chan->disp; struct nvkm_device *device = disp->base.engine.subdev.device; const struct nvkm_device_oclass *sclass = oclass->priv; struct nv50_disp_chan_object *object; int ret; if (!(object = kzalloc(sizeof(*object), GFP_KERNEL))) return -ENOMEM; nvkm_oproxy_ctor(&nv50_disp_chan_child_func_, oclass, &object->oproxy); object->disp = disp; *pobject = &object->oproxy.base; ret = sclass->ctor(device, oclass, argv, argc, &object->oproxy.object); if (ret) return ret; object->hash = chan->func->bind(chan, object->oproxy.object, oclass->handle); if (object->hash < 0) return object->hash; return 0; }
int nvkm_oproxy_new_(const struct nvkm_oproxy_func *func, const struct nvkm_oclass *oclass, struct nvkm_oproxy **poproxy) { if (!(*poproxy = kzalloc(sizeof(**poproxy), GFP_KERNEL))) return -ENOMEM; nvkm_oproxy_ctor(func, oclass, *poproxy); return 0; }