diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-01-14 15:55:38 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-01-23 13:10:55 +1000 |
commit | 12a9c4eaf91b8a374106ce37f9866a3c83e88c05 (patch) | |
tree | 5767015dca1a2a6d24e6bce64bb0b93c25fefe91 /nvkm/subdev/devinit/nv10.c | |
parent | 9b3a67f5cb0f920a3cedbbeb8d1a131656e5b2e6 (diff) |
devinit: tidy up the subdev class definition
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm/subdev/devinit/nv10.c')
-rw-r--r-- | nvkm/subdev/devinit/nv10.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/nvkm/subdev/devinit/nv10.c b/nvkm/subdev/devinit/nv10.c index 8d274dba..32b3d213 100644 --- a/nvkm/subdev/devinit/nv10.c +++ b/nvkm/subdev/devinit/nv10.c @@ -27,17 +27,12 @@ #include <subdev/vga.h> #include "fbmem.h" -#include "priv.h" - -struct nv10_devinit_priv { - struct nouveau_devinit base; - u8 owner; -}; +#include "nv04.h" static void nv10_devinit_meminit(struct nouveau_devinit *devinit) { - struct nv10_devinit_priv *priv = (void *)devinit; + struct nv04_devinit_priv *priv = (void *)devinit; static const int mem_width[] = { 0x10, 0x00, 0x20 }; int mem_width_count; uint32_t patt = 0xdeadbeef; @@ -101,31 +96,15 @@ amount_found: fbmem_fini(fb); } -static int -nv10_devinit_ctor(struct nouveau_object *parent, struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) -{ - struct nv10_devinit_priv *priv; - int ret; - - ret = nouveau_devinit_create(parent, engine, oclass, &priv); - *pobject = nv_object(priv); - if (ret) - return ret; - - priv->base.meminit = nv10_devinit_meminit; - priv->base.pll_set = nv04_devinit_pll_set; - return 0; -} - -struct nouveau_oclass -nv10_devinit_oclass = { - .handle = NV_SUBDEV(DEVINIT, 0x10), - .ofuncs = &(struct nouveau_ofuncs) { - .ctor = nv10_devinit_ctor, +struct nouveau_oclass * +nv10_devinit_oclass = &(struct nouveau_devinit_impl) { + .base.handle = NV_SUBDEV(DEVINIT, 0x10), + .base.ofuncs = &(struct nouveau_ofuncs) { + .ctor = nv04_devinit_ctor, .dtor = nv04_devinit_dtor, .init = nv04_devinit_init, .fini = nv04_devinit_fini, }, -}; + .meminit = nv10_devinit_meminit, + .pll_set = nv04_devinit_pll_set, +}.base; |