diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 07:54:21 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 05:40:44 +0300 |
commit | 54dcadd5b65e12f851ff80af4afef606040ad8b9 (patch) | |
tree | cf82a7cd2909fe75a2dd219320e011cc7b806d53 /drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c | |
parent | 70bc7182cbf1bb07e414bbb553890ddf1b540264 (diff) | |
download | linux-54dcadd5b65e12f851ff80af4afef606040ad8b9.tar.xz |
drm/nouveau/mc: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c index 6e2fb94b6f84..bcba7bc9737b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mc/nv04.c @@ -21,7 +21,7 @@ * * Authors: Ben Skeggs */ -#include "nv04.h" +#include "priv.h" const struct nvkm_mc_intr nv04_mc_intr[] = { @@ -38,42 +38,22 @@ nv04_mc_intr[] = { {} }; -int -nv04_mc_init(struct nvkm_object *object) +void +nv04_mc_init(struct nvkm_mc *mc) { - struct nvkm_mc *mc = (void *)object; struct nvkm_device *device = mc->subdev.device; - nvkm_wr32(device, 0x000200, 0xffffffff); /* everything enabled */ nvkm_wr32(device, 0x001850, 0x00000001); /* disable rom access */ - - return nvkm_mc_init(mc); } +static const struct nvkm_mc_func +nv04_mc = { + .init = nv04_mc_init, + .intr = nv04_mc_intr, +}; + int -nv04_mc_ctor(struct nvkm_object *parent, struct nvkm_object *engine, - struct nvkm_oclass *oclass, void *data, u32 size, - struct nvkm_object **pobject) +nv04_mc_new(struct nvkm_device *device, int index, struct nvkm_mc **pmc) { - struct nvkm_mc *mc; - int ret; - - ret = nvkm_mc_create(parent, engine, oclass, &mc); - *pobject = nv_object(mc); - if (ret) - return ret; - - return 0; + return nvkm_mc_new_(&nv04_mc, device, index, pmc); } - -struct nvkm_oclass * -nv04_mc_oclass = &(struct nvkm_mc_oclass) { - .base.handle = NV_SUBDEV(MC, 0x04), - .base.ofuncs = &(struct nvkm_ofuncs) { - .ctor = nv04_mc_ctor, - .dtor = _nvkm_mc_dtor, - .init = nv04_mc_init, - .fini = _nvkm_mc_fini, - }, - .intr = nv04_mc_intr, -}.base; |