diff mbox series

[v2,3/6] drm/i915/dp: Use a local variable for intel_encoder *

Message ID 20180924224528.4744-3-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/6] drm/i915/dp: Fix link retraining comment in intel_dp_long_pulse() | expand

Commit Message

Dhinakaran Pandiyan Sept. 24, 2018, 10:45 p.m. UTC
We have two cases of intel_dp to intel_encoder conversions, use a
local variable to store the conversion.

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Souza, Jose Sept. 25, 2018, 8:51 p.m. UTC | #1
On Mon, 2018-09-24 at 15:45 -0700, Dhinakaran Pandiyan wrote:
> We have two cases of intel_dp to intel_encoder conversions, use a
> local variable to store the conversion.
> 

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c
> b/drivers/gpu/drm/i915/intel_dp.c
> index 6130d05d8b88..09229fc66dec 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5017,6 +5017,7 @@ intel_dp_long_pulse(struct intel_connector
> *connector,
>  {
>  	struct drm_i915_private *dev_priv = to_i915(connector-
> >base.dev);
>  	struct intel_dp *intel_dp = intel_attached_dp(&connector-
> >base);
> +	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)-
> >base;
>  	enum drm_connector_status status;
>  	u8 sink_irq_vector = 0;
>  
> @@ -5027,7 +5028,7 @@ intel_dp_long_pulse(struct intel_connector
> *connector,
>  	/* Can't disconnect eDP */
>  	if (intel_dp_is_edp(intel_dp))
>  		status = edp_detect(intel_dp);
> -	else if
> (intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base))
> +	else if (intel_digital_port_connected(encoder))
>  		status = intel_dp_detect_dpcd(intel_dp);
>  	else
>  		status = connector_status_disconnected;
> @@ -5078,11 +5079,8 @@ intel_dp_long_pulse(struct intel_connector
> *connector,
>  	 * Some external monitors do not signal loss of link
> synchronization
>  	 * with an IRQ_HPD, so force a link status check.
>  	 */
> -	if (!intel_dp_is_edp(intel_dp)) {
> -		struct intel_encoder *encoder =
> &dp_to_dig_port(intel_dp)->base;
> -
> +	if (!intel_dp_is_edp(intel_dp))
>  		intel_dp_retrain_link(encoder, ctx);
> -	}
>  
>  	/*
>  	 * Clearing NACK and defer counts to get their exact values
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 6130d05d8b88..09229fc66dec 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5017,6 +5017,7 @@  intel_dp_long_pulse(struct intel_connector *connector,
 {
 	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
 	struct intel_dp *intel_dp = intel_attached_dp(&connector->base);
+	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
 	enum drm_connector_status status;
 	u8 sink_irq_vector = 0;
 
@@ -5027,7 +5028,7 @@  intel_dp_long_pulse(struct intel_connector *connector,
 	/* Can't disconnect eDP */
 	if (intel_dp_is_edp(intel_dp))
 		status = edp_detect(intel_dp);
-	else if (intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base))
+	else if (intel_digital_port_connected(encoder))
 		status = intel_dp_detect_dpcd(intel_dp);
 	else
 		status = connector_status_disconnected;
@@ -5078,11 +5079,8 @@  intel_dp_long_pulse(struct intel_connector *connector,
 	 * Some external monitors do not signal loss of link synchronization
 	 * with an IRQ_HPD, so force a link status check.
 	 */
-	if (!intel_dp_is_edp(intel_dp)) {
-		struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
-
+	if (!intel_dp_is_edp(intel_dp))
 		intel_dp_retrain_link(encoder, ctx);
-	}
 
 	/*
 	 * Clearing NACK and defer counts to get their exact values