clockevents: Don't validate dev->mode against CLOCK_EVT_MODE_UNUSED for new interface
It was a requirement in the legacy interface that drivers must initialize ->mode field to 'CLOCK_EVT_MODE_UNUSED'. This field isn't used anymore by the new interface and so should be only checked for the legacy interface. Probably it can be dropped as well as core doesn't rely on it anymore, but lets keep it to support legacy interface. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Kevin Hilman <khilman@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com> Cc: linaro-kernel@lists.linaro.org Cc: linaro-networking@linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/c6604fa1a77fe1fc8dcab87769857228fb1dadd5.1425037853.git.viresh.kumar@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
		
					parent
					
						
							
								77e32c89a7
							
						
					
				
			
			
				commit
				
					
						de81e64b25
					
				
			
		
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -450,6 +450,8 @@ static int clockevents_sanity_check(struct clock_event_device *dev)
 | 
				
			||||||
		/* We shouldn't be supporting new modes now */
 | 
							/* We shouldn't be supporting new modes now */
 | 
				
			||||||
		WARN_ON(dev->set_state_periodic || dev->set_state_oneshot ||
 | 
							WARN_ON(dev->set_state_periodic || dev->set_state_oneshot ||
 | 
				
			||||||
			dev->set_state_shutdown || dev->tick_resume);
 | 
								dev->set_state_shutdown || dev->tick_resume);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -479,7 +481,6 @@ void clockevents_register_device(struct clock_event_device *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	unsigned long flags;
 | 
						unsigned long flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
 | 
					 | 
				
			||||||
	BUG_ON(clockevents_sanity_check(dev));
 | 
						BUG_ON(clockevents_sanity_check(dev));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Initialize state to DETACHED */
 | 
						/* Initialize state to DETACHED */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue