]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
drm/nouveau/therm: fix various style issues, make more consistent
[karo-tx-linux.git] / drivers / gpu / drm / nouveau / core / subdev / therm / nv40.c
index fcf2cfe731d668cf64ec5a65ef63d50bdab877a7..f2092af62ce3bf8ff4736a4a68beea6e7449f7d0 100644 (file)
 
 #include "priv.h"
 
+struct nv40_therm_priv {
+       struct nouveau_therm_priv base;
+};
+
 static int
 nv40_sensor_setup(struct nouveau_therm *therm)
 {
@@ -120,34 +124,21 @@ nv40_fan_pwm_set(struct nouveau_therm *therm, int line, u32 divs, u32 duty)
 
 static int
 nv40_therm_ctor(struct nouveau_object *parent,
-                  struct nouveau_object *engine,
-                  struct nouveau_oclass *oclass, void *data, u32 size,
-                  struct nouveau_object **pobject)
+               struct nouveau_object *engine,
+               struct nouveau_oclass *oclass, void *data, u32 size,
+               struct nouveau_object **pobject)
 {
-       struct nouveau_therm_priv *priv;
-       struct nouveau_therm *therm;
+       struct nv40_therm_priv *priv;
        int ret;
 
        ret = nouveau_therm_create(parent, engine, oclass, &priv);
        *pobject = nv_object(priv);
-       therm = (void *) priv;
        if (ret)
                return ret;
 
-       nouveau_therm_ic_ctor(therm);
-       nouveau_therm_sensor_ctor(therm);
-       nouveau_therm_fan_ctor(therm);
-
-       priv->fan.pwm_get = nv40_fan_pwm_get;
-       priv->fan.pwm_set = nv40_fan_pwm_set;
-
-       therm->temp_get = nv40_temp_get;
-       therm->fan_get = nouveau_therm_fan_user_get;
-       therm->fan_set = nouveau_therm_fan_user_set;
-       therm->fan_sense = nouveau_therm_fan_sense;
-       therm->attr_get = nouveau_therm_attr_get;
-       therm->attr_set = nouveau_therm_attr_set;
-
+       priv->base.fan.pwm_get = nv40_fan_pwm_get;
+       priv->base.fan.pwm_set = nv40_fan_pwm_set;
+       priv->base.base.temp_get = nv40_temp_get;
        return 0;
 }
 
@@ -157,7 +148,7 @@ nv40_therm_oclass = {
        .ofuncs = &(struct nouveau_ofuncs) {
                .ctor = nv40_therm_ctor,
                .dtor = _nouveau_therm_dtor,
-               .init = nouveau_therm_init,
-               .fini = nouveau_therm_fini,
+               .init = _nouveau_therm_init,
+               .fini = _nouveau_therm_fini,
        },
-};
\ No newline at end of file
+};