drm/nve4/graph: do not crash if no power device present
authorAlexandre Courbot <acourbot@nvidia.com>
Tue, 15 Jul 2014 01:36:11 +0000 (10:36 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Sat, 9 Aug 2014 19:11:10 +0000 (05:11 +1000)
Detect and workaround the absence of a power device so chips that do not
feature one (e.g. GK20A) can still use this driver.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/graph/nve4.c

index 1ba6666da4e56ed4177ca975f1c7b030937a3adc..fb9cb929320dd463ee5f9dc43eaa6aca93d67511 100644 (file)
@@ -203,7 +203,8 @@ nve4_graph_init(struct nouveau_object *object)
        int gpc, tpc, rop;
        int ret, i;
 
-       ppwr->pgob(ppwr, false);
+       if (ppwr)
+               ppwr->pgob(ppwr, false);
 
        ret = nouveau_graph_init(&priv->base);
        if (ret)