Commit 79413ed4 authored by Lyude Paul's avatar Lyude Paul
Browse files

drm/dp_mst: Lessen indenting in drm_dp_mst_topology_mgr_resume()



Does what it says on the tin.

Cc: Juston Li <juston.li@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: default avatarSean Paul <sean@poorly.run>
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191022023641.8026-9-lyude@redhat.com
parent dad7d84f
Loading
Loading
Loading
Loading
+29 −30
Original line number Original line Diff line number Diff line
@@ -3210,45 +3210,44 @@ EXPORT_SYMBOL(drm_dp_mst_topology_mgr_suspend);
 */
 */
int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr)
int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr)
{
{
	int ret = 0;
	int ret;
	u8 guid[16];


	mutex_lock(&mgr->lock);
	mutex_lock(&mgr->lock);
	if (!mgr->mst_primary)
		goto out_fail;


	if (mgr->mst_primary) {
	ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd,
		int sret;
			       DP_RECEIVER_CAP_SIZE);
		u8 guid[16];
	if (ret != DP_RECEIVER_CAP_SIZE) {

		sret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd, DP_RECEIVER_CAP_SIZE);
		if (sret != DP_RECEIVER_CAP_SIZE) {
		DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
		DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
			ret = -1;
		goto out_fail;
			goto out_unlock;
	}
	}


	ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
	ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
					 DP_MST_EN | DP_UP_REQ_EN | DP_UPSTREAM_IS_SRC);
				 DP_MST_EN |
				 DP_UP_REQ_EN |
				 DP_UPSTREAM_IS_SRC);
	if (ret < 0) {
	if (ret < 0) {
		DRM_DEBUG_KMS("mst write failed - undocked during suspend?\n");
		DRM_DEBUG_KMS("mst write failed - undocked during suspend?\n");
			ret = -1;
		goto out_fail;
			goto out_unlock;
	}
	}


	/* Some hubs forget their guids after they resume */
	/* Some hubs forget their guids after they resume */
		sret = drm_dp_dpcd_read(mgr->aux, DP_GUID, guid, 16);
	ret = drm_dp_dpcd_read(mgr->aux, DP_GUID, guid, 16);
		if (sret != 16) {
	if (ret != 16) {
		DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
		DRM_DEBUG_KMS("dpcd read failed - undocked during suspend?\n");
			ret = -1;
		goto out_fail;
			goto out_unlock;
	}
	}
	drm_dp_check_mstb_guid(mgr->mst_primary, guid);
	drm_dp_check_mstb_guid(mgr->mst_primary, guid);


		ret = 0;
	mutex_unlock(&mgr->lock);
	} else
		ret = -1;


out_unlock:
	return 0;

out_fail:
	mutex_unlock(&mgr->lock);
	mutex_unlock(&mgr->lock);
	return ret;
	return -1;
}
}
EXPORT_SYMBOL(drm_dp_mst_topology_mgr_resume);
EXPORT_SYMBOL(drm_dp_mst_topology_mgr_resume);