mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	eeprom: at25: use devm_nvmem_register()
Use the resource managed variant of nvmem_register(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
							parent
							
								
									c853d6904f
								
							
						
					
					
						commit
						96d08fb43e
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -366,7 +366,7 @@ static int at25_probe(struct spi_device *spi)
 | 
			
		|||
	at25->nvmem_config.word_size = 1;
 | 
			
		||||
	at25->nvmem_config.size = chip.byte_len;
 | 
			
		||||
 | 
			
		||||
	at25->nvmem = nvmem_register(&at25->nvmem_config);
 | 
			
		||||
	at25->nvmem = devm_nvmem_register(&spi->dev, &at25->nvmem_config);
 | 
			
		||||
	if (IS_ERR(at25->nvmem))
 | 
			
		||||
		return PTR_ERR(at25->nvmem);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -384,7 +384,6 @@ static int at25_remove(struct spi_device *spi)
 | 
			
		|||
	struct at25_data	*at25;
 | 
			
		||||
 | 
			
		||||
	at25 = spi_get_drvdata(spi);
 | 
			
		||||
	nvmem_unregister(at25->nvmem);
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue