gma500: Fix Poulsbo suspend/resume crash on devices with SDVO ports
authorAlan Cox <alan@linux.intel.com>
Mon, 21 May 2012 14:27:44 +0000 (15:27 +0100)
committerDave Airlie <airlied@redhat.com>
Tue, 22 May 2012 09:15:45 +0000 (10:15 +0100)
Reported-by: Guillaume Clément <guillaume@baobob.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/gma500/psb_device.c

index 2a3e2da4ea8e03a6e37cca0bec898ab3a2fd0030..eff039bf92d40ae37fa1481cb5ec7006036ffae4 100644 (file)
@@ -197,7 +197,8 @@ static int psb_save_display_registers(struct drm_device *dev)
        }
 
        list_for_each_entry(connector, &dev->mode_config.connector_list, head)
-               connector->funcs->save(connector);
+               if (connector->funcs->save)
+                       connector->funcs->save(connector);
 
        mutex_unlock(&dev->mode_config.mutex);
        return 0;
@@ -235,7 +236,8 @@ static int psb_restore_display_registers(struct drm_device *dev)
                        crtc->funcs->restore(crtc);
 
        list_for_each_entry(connector, &dev->mode_config.connector_list, head)
-               connector->funcs->restore(connector);
+               if (connector->funcs->restore)
+                       connector->funcs->restore(connector);
 
        mutex_unlock(&dev->mode_config.mutex);
        return 0;