]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Clean up intel_hdcp_disable
authorSean Paul <seanpaul@chromium.org>
Tue, 18 Aug 2020 15:38:56 +0000 (11:38 -0400)
committerRamalingam C <ramalingam.c@intel.com>
Tue, 1 Sep 2020 07:32:33 +0000 (13:02 +0530)
Add an out label and un-indent hdcp disable in preparation for
hdcp_mutex. No functional changes

Reviewed-by: Anshuman Gupta <anshuman.gupta@intel.com>
Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429195502.39919-9-sean@poorly.run
Link: https://patchwork.freedesktop.org/patch/msgid/20200623155907.22961-9-sean@poorly.run
Changes in v7:
-Split into separate patch (Ramalingam)
Changes in v8:
-None

Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200818153910.27894-9-sean@poorly.run
drivers/gpu/drm/i915/display/intel_hdcp.c

index 22d42a323ae8e8a5eccc890efcc74e4ae24e43e2..f4939f63d8dd1041804f93fcc07674d8c88a18d2 100644 (file)
@@ -2103,16 +2103,17 @@ int intel_hdcp_disable(struct intel_connector *connector)
 
        mutex_lock(&hdcp->mutex);
 
-       if (hdcp->value != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
-               intel_hdcp_update_value(connector,
-                                       DRM_MODE_CONTENT_PROTECTION_UNDESIRED,
-                                       false);
-               if (hdcp->hdcp2_encrypted)
-                       ret = _intel_hdcp2_disable(connector);
-               else if (hdcp->hdcp_encrypted)
-                       ret = _intel_hdcp_disable(connector);
-       }
+       if (hdcp->value == DRM_MODE_CONTENT_PROTECTION_UNDESIRED)
+               goto out;
 
+       intel_hdcp_update_value(connector,
+                               DRM_MODE_CONTENT_PROTECTION_UNDESIRED, false);
+       if (hdcp->hdcp2_encrypted)
+               ret = _intel_hdcp2_disable(connector);
+       else if (hdcp->hdcp_encrypted)
+               ret = _intel_hdcp_disable(connector);
+
+out:
        mutex_unlock(&hdcp->mutex);
        cancel_delayed_work_sync(&hdcp->check_work);
        return ret;