mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	rust: phy: implement Send for Registration
				
					
				
			In preparation for requiring `Send` for `Module` implementations in the next patch. Cc: FUJITA Tomonori <fujita.tomonori@gmail.com> Cc: Trevor Gross <tmgross@umich.edu> Cc: netdev@vger.kernel.org Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240328195457.225001-2-wedsonaf@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
		
							parent
							
								
									8933cf4651
								
							
						
					
					
						commit
						df70d04d56
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		|  | @ -640,6 +640,10 @@ pub struct Registration { | |||
|     drivers: Pin<&'static mut [DriverVTable]>, | ||||
| } | ||||
| 
 | ||||
| // SAFETY: The only action allowed in a `Registration` instance is dropping it, which is safe to do
 | ||||
| // from any thread because `phy_drivers_unregister` can be called from any thread context.
 | ||||
| unsafe impl Send for Registration {} | ||||
| 
 | ||||
| impl Registration { | ||||
|     /// Registers a PHY driver.
 | ||||
|     pub fn register( | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Wedson Almeida Filho
						Wedson Almeida Filho