[v4,2/2] drm/i915/hdcp: Fix config_stream_type() ret value
diff mbox series

Message ID 20200303073838.25871-1-anshuman.gupta@intel.com
State New
Headers show
Series
  • Untitled series #250321
Related show

Commit Message

Anshuman Gupta March 3, 2020, 7:38 a.m. UTC
DP shim's config_stream_type considered to be succeeded when
return value of intel_dp_hdcp2_write_msg() equals to size of
message to be written, it makes config_stream_type to return
a zero success value in order to succeed the HDCP auth.

v2:
- config_stream_type() returns 0 on success. [Ram]

CC: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Ramalingam C March 3, 2020, 10:20 a.m. UTC | #1
On 2020-03-03 at 13:08:38 +0530, Anshuman Gupta wrote:
> DP shim's config_stream_type considered to be succeeded when
> return value of intel_dp_hdcp2_write_msg() equals to size of
> message to be written, it makes config_stream_type to return
> a zero success value in order to succeed the HDCP auth.
> 
> v2:
> - config_stream_type() returns 0 on success. [Ram]
> 
> CC: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 2db8d46f61a1..588d0bf37349 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -6448,6 +6448,7 @@ static
>  int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *intel_dig_port,
>  				      bool is_repeater, u8 content_type)
>  {
> +	int ret;
Order it as per the length of the declations. long->short...
>  	struct hdcp2_dp_errata_stream_type stream_type_msg;
>  
>  	if (is_repeater)
> @@ -6463,8 +6464,11 @@ int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *intel_dig_port,
>  	stream_type_msg.msg_id = HDCP_2_2_ERRATA_DP_STREAM_TYPE;
>  	stream_type_msg.stream_type = content_type;
>  
> -	return intel_dp_hdcp2_write_msg(intel_dig_port, &stream_type_msg,
> +	ret =  intel_dp_hdcp2_write_msg(intel_dig_port, &stream_type_msg,
>  					sizeof(stream_type_msg));
> +
> +	return ret < 0 ? ret : 0;
> +
With that fixed, Looks Good to me.

Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
>  }
>  
>  static
> -- 
> 2.25.1
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 2db8d46f61a1..588d0bf37349 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -6448,6 +6448,7 @@  static
 int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *intel_dig_port,
 				      bool is_repeater, u8 content_type)
 {
+	int ret;
 	struct hdcp2_dp_errata_stream_type stream_type_msg;
 
 	if (is_repeater)
@@ -6463,8 +6464,11 @@  int intel_dp_hdcp2_config_stream_type(struct intel_digital_port *intel_dig_port,
 	stream_type_msg.msg_id = HDCP_2_2_ERRATA_DP_STREAM_TYPE;
 	stream_type_msg.stream_type = content_type;
 
-	return intel_dp_hdcp2_write_msg(intel_dig_port, &stream_type_msg,
+	ret =  intel_dp_hdcp2_write_msg(intel_dig_port, &stream_type_msg,
 					sizeof(stream_type_msg));
+
+	return ret < 0 ? ret : 0;
+
 }
 
 static