mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-05 10:45:26 +07:00
drm/nouveau/core: add nvkm_subdev_new_() for bare subdevs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
fa4f4c213f
commit
f02ca8425a
@ -24,6 +24,8 @@ struct nvkm_subdev_func {
|
||||
};
|
||||
|
||||
extern const char *nvkm_subdev_name[NVKM_SUBDEV_NR];
|
||||
int nvkm_subdev_new_(const struct nvkm_subdev_func *, struct nvkm_device *,
|
||||
int index, struct nvkm_subdev **);
|
||||
void nvkm_subdev_ctor(const struct nvkm_subdev_func *, struct nvkm_device *,
|
||||
int index, struct nvkm_subdev *);
|
||||
void nvkm_subdev_del(struct nvkm_subdev **);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user