diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:15 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:40:30 +1000 |
commit | 47b2505efb2d951f16c3a229d93450b463d925e5 (patch) | |
tree | d50508c076a4719a948647eb6a0ba8051b6e1102 /drivers/gpu/drm/nouveau/nvkm | |
parent | f2c906fc0cf1657e4164e09ae6061534eebd5430 (diff) |
drm/nouveau/platform: remove subclassing of nvkm_device
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c | 10 |
3 files changed, 12 insertions, 16 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c index 2d10dc17238d..ce89955ff8f9 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gk20a.c @@ -650,8 +650,8 @@ gk20a_clk_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_object **pobject) { + struct nvkm_device *device = (void *)parent; struct gk20a_clk *clk; - struct nouveau_platform_device *plat; int ret; int i; @@ -670,8 +670,7 @@ gk20a_clk_ctor(struct nvkm_object *parent, struct nvkm_object *engine, clk->params = &gk20a_pllg_params; - plat = nv_device_to_platform(nv_device(parent)); - clk->parent_rate = clk_get_rate(plat->gpu->clk); + clk->parent_rate = clk_get_rate(device->gpu->clk); nvkm_info(&clk->base.subdev, "parent clock rate: %d Mhz\n", clk->parent_rate / MHZ); diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c index f5642698406a..e6370382109b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c @@ -396,8 +396,8 @@ gk20a_instmem_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_object **pobject) { + struct nvkm_device *device = (void *)parent; struct gk20a_instmem *imem; - struct nouveau_platform_device *plat; int ret; ret = nvkm_instmem_create(parent, engine, oclass, &imem); @@ -407,12 +407,11 @@ gk20a_instmem_ctor(struct nvkm_object *parent, struct nvkm_object *engine, spin_lock_init(&imem->lock); - plat = nv_device_to_platform(nv_device(parent)); - if (plat->gpu->iommu.domain) { - imem->domain = plat->gpu->iommu.domain; - imem->mm = plat->gpu->iommu.mm; - imem->iommu_pgshift = plat->gpu->iommu.pgshift; - imem->mm_mutex = &plat->gpu->iommu.mutex; + if (device->gpu->iommu.domain) { + imem->domain = device->gpu->iommu.domain; + imem->mm = device->gpu->iommu.mm; + imem->iommu_pgshift = device->gpu->iommu.pgshift; + imem->mm_mutex = &device->gpu->iommu.mutex; nvkm_info(&imem->base.subdev, "using IOMMU\n"); } else { diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c index d86f4eaba04c..59fa2cf898d2 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk20a.c @@ -152,8 +152,8 @@ gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_object **pobject) { + struct nvkm_device *device = (void *)parent; struct gk20a_volt *volt; - struct nouveau_platform_device *plat; int i, ret, uv; ret = nvkm_volt_create(parent, engine, oclass, &volt); @@ -161,12 +161,10 @@ gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine, if (ret) return ret; - plat = nv_device_to_platform(nv_device(parent)); - - uv = regulator_get_voltage(plat->gpu->vdd); + uv = regulator_get_voltage(device->gpu->vdd); nvkm_info(&volt->base.subdev, "The default voltage is %duV\n", uv); - volt->vdd = plat->gpu->vdd; + volt->vdd = device->gpu->vdd; volt->base.vid_get = gk20a_volt_vid_get; volt->base.vid_set = gk20a_volt_vid_set; volt->base.set_id = gk20a_volt_set_id; @@ -178,7 +176,7 @@ gk20a_volt_ctor(struct nvkm_object *parent, struct nvkm_object *engine, volt->base.vid[i].vid = i; volt->base.vid[i].uv = gk20a_volt_calc_voltage(&gk20a_cvb_coef[i], - plat->gpu_speedo); + device->gpu->gpu_speedo); nvkm_debug(&volt->base.subdev, "%2d: vid=%d, uv=%d\n", i, volt->base.vid[i].vid, volt->base.vid[i].uv); } |