mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	thunderbolt: Correct TMU mode initialization from hardware
David reported that cppcheck found following possible copy & paste
error from tmu_mode_init():
  tmu.c:385:50: style: Expression is always false because 'else if' condition matches previous condition at line 383. [multiCondition]
And indeed this is a bug. Fix it to use correct index
(TB_SWITCH_TMU_MODE_HIFI_UNI).
Reported-by: David Binderman <dcb314@hotmail.com>
Fixes: d49b4f043d ("thunderbolt: Add support for enhanced uni-directional TMU mode")
Cc: stable@vger.kernel.org
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
			
			
This commit is contained in:
		
							parent
							
								
									a9fdf5f933
								
							
						
					
					
						commit
						e19f714ea6
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -382,7 +382,7 @@ static int tmu_mode_init(struct tb_switch *sw)
 | 
			
		|||
		} else if (ucap && tb_port_tmu_is_unidirectional(up)) {
 | 
			
		||||
			if (tmu_rates[TB_SWITCH_TMU_MODE_LOWRES] == rate)
 | 
			
		||||
				sw->tmu.mode = TB_SWITCH_TMU_MODE_LOWRES;
 | 
			
		||||
			else if (tmu_rates[TB_SWITCH_TMU_MODE_LOWRES] == rate)
 | 
			
		||||
			else if (tmu_rates[TB_SWITCH_TMU_MODE_HIFI_UNI] == rate)
 | 
			
		||||
				sw->tmu.mode = TB_SWITCH_TMU_MODE_HIFI_UNI;
 | 
			
		||||
		} else if (rate) {
 | 
			
		||||
			sw->tmu.mode = TB_SWITCH_TMU_MODE_HIFI_BI;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue