{
struct drm_device *drm_dev = dev_get_drvdata(dev);
struct drm_connector *connector;
+ struct drm_connector_list_iter conn_iter;
if (pm_runtime_suspended(dev) || !drm_dev)
return 0;
- drm_modeset_lock_all(drm_dev);
- drm_for_each_connector(connector, drm_dev) {
+ drm_connector_list_iter_begin(drm_dev, &conn_iter);
+ drm_for_each_connector_iter(connector, &conn_iter) {
int old_dpms = connector->dpms;
if (connector->funcs->dpms)
/* Set the old mode back to the connector for resume */
connector->dpms = old_dpms;
}
- drm_modeset_unlock_all(drm_dev);
+ drm_connector_list_iter_end(&conn_iter);
return 0;
}
{
struct drm_device *drm_dev = dev_get_drvdata(dev);
struct drm_connector *connector;
+ struct drm_connector_list_iter conn_iter;
if (pm_runtime_suspended(dev) || !drm_dev)
return 0;
- drm_modeset_lock_all(drm_dev);
- drm_for_each_connector(connector, drm_dev) {
+ drm_connector_list_iter_begin(drm_dev, &conn_iter);
+ drm_for_each_connector_iter(connector, &conn_iter) {
if (connector->funcs->dpms) {
int dpms = connector->dpms;
connector->funcs->dpms(connector, dpms);
}
}
- drm_modeset_unlock_all(drm_dev);
+ drm_connector_list_iter_end(&conn_iter);
return 0;
}