int nvkm_devinit_pll_set(struct nvkm_devinit *, u32 type, u32 khz);
void nvkm_devinit_meminit(struct nvkm_devinit *);
u64 nvkm_devinit_disable(struct nvkm_devinit *);
+int nvkm_devinit_post(struct nvkm_devinit *, u64 *disable);
int nv04_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
int nv05_devinit_new(struct nvkm_device *, int, struct nvkm_devinit **);
}
}
- /*XXX: devinit */
+ ret = nvkm_devinit_post(device->devinit, &device->disable_mask);
+ if (ret)
+ goto fail;
time = ktime_to_us(ktime_get()) - time;
nvdev_trace(device, "preinit completed in %lldus\n", time);
u64
nvkm_devinit_disable(struct nvkm_devinit *init)
{
- if (init->func->disable)
+ if (init && init->func->disable)
return init->func->disable(init);
return 0;
}
+int
+nvkm_devinit_post(struct nvkm_devinit *init, u64 *disable)
+{
+ int ret = 0;
+ if (init && init->func->post)
+ ret = init->func->post(init, init->post);
+ *disable = nvkm_devinit_disable(init);
+ return ret;
+}
+
static int
nvkm_devinit_fini(struct nvkm_subdev *subdev, bool suspend)
{
nvkm_devinit_init(struct nvkm_subdev *subdev)
{
struct nvkm_devinit *init = nvkm_devinit(subdev);
- int ret;
-
- ret = init->func->post(init, init->post);
- if (ret)
- return ret;
-
if (init->func->init)
init->func->init(init);
-
- if (init->func->disable)
- subdev->device->disable_mask |= init->func->disable(init);
return 0;
}