diff mbox series

drm/i915/icl: replace check for combo phy

Message ID 20181108233439.10066-1-lucas.demarchi@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/icl: replace check for combo phy | expand

Commit Message

Lucas De Marchi Nov. 8, 2018, 11:34 p.m. UTC
These are the only places that assume ports A and B are the ones with
combo phy.  Let's use intel_port_is_combophy() there to make sure
it check for combo phy ports the same way everywhere.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/intel_combo_phy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Imre Deak Nov. 9, 2018, 12:06 a.m. UTC | #1
On Thu, Nov 08, 2018 at 03:34:39PM -0800, Lucas De Marchi wrote:
> These are the only places that assume ports A and B are the ones with
> combo phy.  Let's use intel_port_is_combophy() there to make sure
> it check for combo phy ports the same way everywhere.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_combo_phy.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_combo_phy.c b/drivers/gpu/drm/i915/intel_combo_phy.c
> index f7c16f6724f0..2bc0200806ad 100644
> --- a/drivers/gpu/drm/i915/intel_combo_phy.c
> +++ b/drivers/gpu/drm/i915/intel_combo_phy.c
> @@ -199,7 +199,7 @@ void icl_combo_phys_init(struct drm_i915_private *dev_priv)
>  {
>  	enum port port;
>  
> -	for (port = PORT_A; port <= PORT_B; port++) {
> +	for (port = PORT_A; intel_port_is_combophy(dev_priv, port); port++) {
>  		u32 val;
>  
>  		if (icl_combo_phy_verify_state(dev_priv, port)) {
> @@ -228,7 +228,7 @@ void icl_combo_phys_uninit(struct drm_i915_private *dev_priv)
>  {
>  	enum port port;
>  
> -	for (port = PORT_A; port <= PORT_B; port++) {
> +	for (port = PORT_A; intel_port_is_combophy(dev_priv, port); port++) {

Would be better to reverse at one point the uninit order as Jose
noticed, so could we have a for_each_combophy_port /
for_each_combophy_port_rev instead?

>  		u32 val;
>  
>  		if (!icl_combo_phy_verify_state(dev_priv, port))
> -- 
> 2.19.1.1.g56c4683e68
>
Lucas De Marchi Nov. 12, 2018, 11:18 p.m. UTC | #2
On 11/8/18 4:06 PM, Imre Deak wrote:
> On Thu, Nov 08, 2018 at 03:34:39PM -0800, Lucas De Marchi wrote:
>> These are the only places that assume ports A and B are the ones with
>> combo phy.  Let's use intel_port_is_combophy() there to make sure
>> it check for combo phy ports the same way everywhere.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_combo_phy.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_combo_phy.c b/drivers/gpu/drm/i915/intel_combo_phy.c
>> index f7c16f6724f0..2bc0200806ad 100644
>> --- a/drivers/gpu/drm/i915/intel_combo_phy.c
>> +++ b/drivers/gpu/drm/i915/intel_combo_phy.c
>> @@ -199,7 +199,7 @@ void icl_combo_phys_init(struct drm_i915_private *dev_priv)
>>   {
>>   	enum port port;
>>   
>> -	for (port = PORT_A; port <= PORT_B; port++) {
>> +	for (port = PORT_A; intel_port_is_combophy(dev_priv, port); port++) {
>>   		u32 val;
>>   
>>   		if (icl_combo_phy_verify_state(dev_priv, port)) {
>> @@ -228,7 +228,7 @@ void icl_combo_phys_uninit(struct drm_i915_private *dev_priv)
>>   {
>>   	enum port port;
>>   
>> -	for (port = PORT_A; port <= PORT_B; port++) {
>> +	for (port = PORT_A; intel_port_is_combophy(dev_priv, port); port++) {
> 
> Would be better to reverse at one point the uninit order as Jose
> noticed, so could we have a for_each_combophy_port /
> for_each_combophy_port_rev instead?

I have another series I'm preparing to keep the phy type. I was planning 
to add such define there, but I can move it here.

I see doing the uninit in reverse order as not really required, but I'm 
adding a commit to change that.


thanks
Lucas De Marchi

> 
>>   		u32 val;
>>   
>>   		if (!icl_combo_phy_verify_state(dev_priv, port))
>> -- 
>> 2.19.1.1.g56c4683e68
>>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_combo_phy.c b/drivers/gpu/drm/i915/intel_combo_phy.c
index f7c16f6724f0..2bc0200806ad 100644
--- a/drivers/gpu/drm/i915/intel_combo_phy.c
+++ b/drivers/gpu/drm/i915/intel_combo_phy.c
@@ -199,7 +199,7 @@  void icl_combo_phys_init(struct drm_i915_private *dev_priv)
 {
 	enum port port;
 
-	for (port = PORT_A; port <= PORT_B; port++) {
+	for (port = PORT_A; intel_port_is_combophy(dev_priv, port); port++) {
 		u32 val;
 
 		if (icl_combo_phy_verify_state(dev_priv, port)) {
@@ -228,7 +228,7 @@  void icl_combo_phys_uninit(struct drm_i915_private *dev_priv)
 {
 	enum port port;
 
-	for (port = PORT_A; port <= PORT_B; port++) {
+	for (port = PORT_A; intel_port_is_combophy(dev_priv, port); port++) {
 		u32 val;
 
 		if (!icl_combo_phy_verify_state(dev_priv, port))