drm/nouveau/pm: fix oops if chipset has no pm support at all
authorBen Skeggs <bskeggs@redhat.com>
Wed, 7 Mar 2012 04:18:49 +0000 (14:18 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 13 Mar 2012 07:15:02 +0000 (17:15 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_pm.c

index dcc16927716faef72952a1c20bd9f4c2dedd46c4..34d591b7d4efe91d1221d0ae11131157efcdcca9 100644 (file)
@@ -284,9 +284,11 @@ nouveau_pm_perflvl_get(struct drm_device *dev, struct nouveau_pm_level *perflvl)
 
        memset(perflvl, 0, sizeof(*perflvl));
 
-       ret = pm->clocks_get(dev, perflvl);
-       if (ret)
-               return ret;
+       if (pm->clocks_get) {
+               ret = pm->clocks_get(dev, perflvl);
+               if (ret)
+                       return ret;
+       }
 
        if (pm->voltage.supported && pm->voltage_get) {
                ret = pm->voltage_get(dev);