mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	counter: constify the struct device_type usage
Since commit aed65af1cc ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
counter_device_type variable to be a constant structure as well, placing it
into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240219-device_cleanup-counter-v1-1-24d0316ae815@marliere.net
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
			
			
This commit is contained in:
		
							parent
							
								
									6b0828ca8b
								
							
						
					
					
						commit
						e0363c0706
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -49,7 +49,7 @@ static void counter_device_release(struct device *dev) | |||
| 	kfree(container_of(counter, struct counter_device_allochelper, counter)); | ||||
| } | ||||
| 
 | ||||
| static struct device_type counter_device_type = { | ||||
| static const struct device_type counter_device_type = { | ||||
| 	.name = "counter_device", | ||||
| 	.release = counter_device_release, | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Ricardo B. Marliere
						Ricardo B. Marliere