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:45 +0300 |
commit | 57113c0170b9efeacb3e3e9d4c2178c30d9cd991 (patch) | |
tree | 007035ee3ef1d47f26a8126eeb863b79e4b70edd /drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c | |
parent | e2ca4e7d6e56cb73a068708f0b0c9bd62ab9e02c (diff) | |
download | linux-57113c0170b9efeacb3e3e9d4c2178c30d9cd991.tar.xz |
drm/nouveau/therm: convert to new-style nvkm_subdev
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c index 7e1f21d81eb1..64fe8f22336c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/fantog.c @@ -38,8 +38,8 @@ struct nvkm_fantog { static void nvkm_fantog_update(struct nvkm_fantog *fan, int percent) { - struct nvkm_therm_priv *therm = (void *)fan->base.parent; - struct nvkm_device *device = therm->base.subdev.device; + struct nvkm_therm *therm = fan->base.parent; + struct nvkm_device *device = therm->subdev.device; struct nvkm_timer *tmr = device->timer; struct nvkm_gpio *gpio = device->gpio; unsigned long flags; @@ -71,33 +71,30 @@ nvkm_fantog_alarm(struct nvkm_alarm *alarm) } static int -nvkm_fantog_get(struct nvkm_therm *obj) +nvkm_fantog_get(struct nvkm_therm *therm) { - struct nvkm_therm_priv *therm = container_of(obj, typeof(*therm), base); struct nvkm_fantog *fan = (void *)therm->fan; return fan->percent; } static int -nvkm_fantog_set(struct nvkm_therm *obj, int percent) +nvkm_fantog_set(struct nvkm_therm *therm, int percent) { - struct nvkm_therm_priv *therm = container_of(obj, typeof(*therm), base); struct nvkm_fantog *fan = (void *)therm->fan; - if (therm->base.pwm_ctrl) - therm->base.pwm_ctrl(&therm->base, fan->func.line, false); + if (therm->func->pwm_ctrl) + therm->func->pwm_ctrl(therm, fan->func.line, false); nvkm_fantog_update(fan, percent); return 0; } int -nvkm_fantog_create(struct nvkm_therm *obj, struct dcb_gpio_func *func) +nvkm_fantog_create(struct nvkm_therm *therm, struct dcb_gpio_func *func) { - struct nvkm_therm_priv *therm = container_of(obj, typeof(*therm), base); struct nvkm_fantog *fan; int ret; - if (therm->base.pwm_ctrl) { - ret = therm->base.pwm_ctrl(&therm->base, func->line, false); + if (therm->func->pwm_ctrl) { + ret = therm->func->pwm_ctrl(therm, func->line, false); if (ret) return ret; } |