Skip to content

Commit

Permalink
eeprom: at25: use devm_nvmem_register()
Browse files Browse the repository at this point in the history
Use the resource managed variant of nvmem_register().

Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Srinivas Kandagatla <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
brgl authored and gregkh committed Sep 28, 2018
1 parent c853d69 commit 96d08fb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/misc/eeprom/at25.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
}
Expand Down

0 comments on commit 96d08fb

Please sign in to comment.