drm/nouveau/therm: no toggle fan control either if we can't guarantee no pwm connected
authorBen Skeggs <bskeggs@redhat.com>
Mon, 4 Nov 2013 23:58:27 +0000 (09:58 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 8 Nov 2013 05:40:02 +0000 (15:40 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/therm/fantog.c

index e601773ee475248635856ad035393e4793ee7a82..f69dab11f720110a4af35229db663e41f58623cd 100644 (file)
@@ -97,6 +97,13 @@ nouveau_fantog_create(struct nouveau_therm *therm, struct dcb_gpio_func *func)
 {
        struct nouveau_therm_priv *tpriv = (void *)therm;
        struct nouveau_fantog_priv *priv;
+       int ret;
+
+       if (therm->pwm_ctrl) {
+               ret = therm->pwm_ctrl(therm, func->line, false);
+               if (ret)
+                       return ret;
+       }
 
        priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        tpriv->fan = &priv->base;