static int nouveau_cli_init(struct nouveau_drm *drm, const char *sname, struct nouveau_cli *cli) { u64 device = nouveau_name(drm->dev); int ret; snprintf(cli->name, sizeof(cli->name), "%s", sname); cli->dev = drm->dev; mutex_init(&cli->mutex); usif_client_init(cli); if (cli == &drm->client) { ret = nvif_driver_init(NULL, nouveau_config, nouveau_debug, cli->name, device, &cli->base); } else { ret = nvif_client_init(&drm->client.base, cli->name, device, &cli->base); } if (ret) { NV_ERROR(drm, "Client allocation failed: %d\n", ret); goto done; } ret = nvif_device_init(&cli->base.object, 0, NV_DEVICE, &(struct nv_device_v0) { .device = ~0, }, sizeof(struct nv_device_v0),
static int nouveau_cli_create(u64 name, const char *sname, int size, void **pcli) { struct nouveau_cli *cli = *pcli = kzalloc(size, GFP_KERNEL); if (cli) { int ret = nvif_client_init(NULL, NULL, sname, name, nouveau_config, nouveau_debug, &cli->base); if (ret == 0) { mutex_init(&cli->mutex); usif_client_init(cli); } return ret; } return -ENOMEM; }
static int nouveau_cli_create(struct drm_device *dev, const char *sname, int size, void **pcli) { struct nouveau_cli *cli = *pcli = kzalloc(size, GFP_KERNEL); int ret; if (cli) { snprintf(cli->name, sizeof(cli->name), "%s", sname); cli->dev = dev; ret = nvif_client_init(NULL, cli->name, nouveau_name(dev), nouveau_config, nouveau_debug, &cli->base); if (ret == 0) { mutex_init(&cli->mutex); usif_client_init(cli); } return ret; } return -ENOMEM; }