diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-12-04 01:35:40 (GMT) |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-02-20 06:00:16 (GMT) |
commit | 5f066c32a50eac584c0c8c19d8d5e38714f7c574 (patch) | |
tree | e6211ed14764407d23e3815fd494f77eda75bfe6 /drivers/gpu/drm/nouveau/core/subdev/therm/base.c | |
parent | bc79202f4c8ff6977133255dc2bb7d4dac3936f0 (diff) | |
download | linux-fsl-qoriq-5f066c32a50eac584c0c8c19d8d5e38714f7c574.tar.xz |
drm/nouveau/therm: fix various style issues, make more consistent
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/subdev/therm/base.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/therm/base.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c index 1674c74..6260eac 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/base.c @@ -116,7 +116,7 @@ nouveau_therm_attr_set(struct nouveau_therm *therm, } int -nouveau_therm_init(struct nouveau_object *object) +_nouveau_therm_init(struct nouveau_object *object) { struct nouveau_therm *therm = (void *)object; struct nouveau_therm_priv *priv = (void *)therm; @@ -133,7 +133,7 @@ nouveau_therm_init(struct nouveau_object *object) } int -nouveau_therm_fini(struct nouveau_object *object, bool suspend) +_nouveau_therm_fini(struct nouveau_object *object, bool suspend) { struct nouveau_therm *therm = (void *)object; struct nouveau_therm_priv *priv = (void *)therm; @@ -142,3 +142,30 @@ nouveau_therm_fini(struct nouveau_object *object, bool suspend) return nouveau_subdev_fini(&therm->base, suspend); } + +int +nouveau_therm_create_(struct nouveau_object *parent, + struct nouveau_object *engine, + struct nouveau_oclass *oclass, + int length, void **pobject) +{ + struct nouveau_therm_priv *priv; + int ret; + + ret = nouveau_subdev_create_(parent, engine, oclass, 0, "PTHERM", + "therm", length, pobject); + priv = *pobject; + if (ret) + return ret; + + nouveau_therm_ic_ctor(&priv->base); + nouveau_therm_sensor_ctor(&priv->base); + nouveau_therm_fan_ctor(&priv->base); + + priv->base.fan_get = nouveau_therm_fan_user_get; + priv->base.fan_set = nouveau_therm_fan_user_set; + priv->base.fan_sense = nouveau_therm_fan_sense; + priv->base.attr_get = nouveau_therm_attr_get; + priv->base.attr_set = nouveau_therm_attr_set; + return 0; +} |