diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2020-02-11 17:34:58 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-05-22 11:13:48 +1000 |
commit | f02ca8425a5c49a3751ca0045f1ec14b3c84a05f (patch) | |
tree | c0f9f9f3e49a0a6cb289efe9fe3f8ea98976b4f2 /drivers/gpu/drm/nouveau/nvkm/core | |
parent | fa4f4c213f5f7807360c41f2501a3031a9940f3a (diff) | |
download | lwn-f02ca8425a5c49a3751ca0045f1ec14b3c84a05f.tar.gz lwn-f02ca8425a5c49a3751ca0045f1ec14b3c84a05f.zip |
drm/nouveau/core: add nvkm_subdev_new_() for bare subdevs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/core')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/core/subdev.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c index 79a8f9d305c5..49d468b45d3f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/subdev.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/subdev.c @@ -221,3 +221,14 @@ nvkm_subdev_ctor(const struct nvkm_subdev_func *func, __mutex_init(&subdev->mutex, name, &nvkm_subdev_lock_class[index]); subdev->debug = nvkm_dbgopt(device->dbgopt, name); } + +int +nvkm_subdev_new_(const struct nvkm_subdev_func *func, + struct nvkm_device *device, int index, + struct nvkm_subdev **psubdev) +{ + if (!(*psubdev = kzalloc(sizeof(**psubdev), GFP_KERNEL))) + return -ENOMEM; + nvkm_subdev_ctor(func, device, index, *psubdev); + return 0; +} |