drm/nouveau/device: convert to engine, rather than subdev
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / nouveau / core / core / engine.c
index 09b3bd502fd05daccaf3292d1cd872e5e741e312..c8bed4a2683339072786a0b4d146b06c9594cc5b 100644 (file)
@@ -33,7 +33,6 @@ nouveau_engine_create_(struct nouveau_object *parent,
                       const char *iname, const char *fname,
                       int length, void **pobject)
 {
-       struct nouveau_device *device = nv_device(parent);
        struct nouveau_engine *engine;
        int ret;
 
@@ -43,7 +42,8 @@ nouveau_engine_create_(struct nouveau_object *parent,
        if (ret)
                return ret;
 
-       if (!nouveau_boolopt(device->cfgopt, iname, enable)) {
+       if ( parent &&
+           !nouveau_boolopt(nv_device(parent)->cfgopt, iname, enable)) {
                if (!enable)
                        nv_warn(engine, "disabled, %s=1 to enable\n", iname);
                return -ENODEV;