/* Just figures out what the actual struct drm_device associated with @dev is and calls its suspend hook, if present.  */
static int drm_class_suspend(struct device *dev, pm_message_t state)
/* Just figures out what the actual struct drm_device associated with @dev is and calls its suspend hook, if present.  */
static int drm_class_suspend(struct device *dev, pm_message_t state)
{
	if (dev->type == &drm_sysfs_device_minor) {
		struct drm_minor *drm_minor = to_drm_minor(dev);
		struct drm_device *drm_dev = drm_minor->dev;
		if (drm_minor->type == DRM_MINOR_LEGACY &&
		    !drm_core_check_feature(drm_dev, DRIVER_MODESET) &&
		    drm_dev->driver->suspend)
			return drm_dev->driver->suspend(drm_dev, state);
	}
	return 0;
}