Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau/core/client: pass notification callback to nvkm_client_new

Preparation for supporting subclients.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+9 -12
+3 -1
drivers/gpu/drm/nouveau/include/nvkm/core/client.h
··· 20 20 }; 21 21 22 22 int nvkm_client_new(const char *name, u64 device, const char *cfg, 23 - const char *dbg, struct nvkm_client **); 23 + const char *dbg, 24 + int (*)(const void *, u32, const void *, u32), 25 + struct nvkm_client **); 24 26 25 27 int nvkm_client_notify_new(struct nvkm_object *, struct nvkm_event *, 26 28 void *data, u32 size);
+2 -10
drivers/gpu/drm/nouveau/nouveau_nvif.c
··· 103 103 nvkm_client_driver_init(const char *name, u64 device, const char *cfg, 104 104 const char *dbg, void **ppriv) 105 105 { 106 - struct nvkm_client *client; 107 - int ret; 108 - 109 - ret = nvkm_client_new(name, device, cfg, dbg, &client); 110 - *ppriv = client; 111 - if (ret) 112 - return ret; 113 - 114 - client->ntfy = nvkm_client_ntfy; 115 - return 0; 106 + return nvkm_client_new(name, device, cfg, dbg, nvkm_client_ntfy, 107 + (struct nvkm_client **)ppriv); 116 108 } 117 109 118 110 const struct nvif_driver
+4 -1
drivers/gpu/drm/nouveau/nvkm/core/client.c
··· 238 238 239 239 int 240 240 nvkm_client_new(const char *name, u64 device, const char *cfg, 241 - const char *dbg, struct nvkm_client **pclient) 241 + const char *dbg, 242 + int (*ntfy)(const void *, u32, const void *, u32), 243 + struct nvkm_client **pclient) 242 244 { 243 245 struct nvkm_oclass oclass = { .base = nvkm_uclient_sclass }; 244 246 struct nvkm_client *client; ··· 254 252 client->device = device; 255 253 client->debug = nvkm_dbgopt(dbg, "CLIENT"); 256 254 client->objroot = RB_ROOT; 255 + client->ntfy = ntfy; 257 256 return 0; 258 257 }