summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorBartosz Golaszewski <brgl@bgdev.pl>2018-04-05 09:49:20 +0200
committerBartosz Golaszewski <brgl@bgdev.pl>2018-05-16 14:42:46 +0200
commitbbe69841bdfa86333b39cf7a5c7d7273b5324143 (patch)
treee05e8e85f648c16a017dba70bca505a9e516bf71 /drivers/misc
parent5fa4d14e55ec5370dcb373d2aa7a882ea9b5be16 (diff)
eeprom: at24: use devm_nvmem_register()
We now have a managed variant of nvmem_register(). Use it in at24_probe(). Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Reviewed-by: Peter Rosin <peda@axentia.se>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/eeprom/at24.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 33053b0d1fdf..5072c6d0fa61 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -685,7 +685,7 @@ static int at24_probe(struct i2c_client *client)
nvmem_config.word_size = 1;
nvmem_config.size = pdata.byte_len;
- at24->nvmem = nvmem_register(&nvmem_config);
+ at24->nvmem = devm_nvmem_register(dev, &nvmem_config);
if (IS_ERR(at24->nvmem)) {
err = PTR_ERR(at24->nvmem);
goto err_clients;
@@ -718,8 +718,6 @@ static int at24_remove(struct i2c_client *client)
at24 = i2c_get_clientdata(client);
- nvmem_unregister(at24->nvmem);
-
for (i = 1; i < at24->num_addresses; i++)
i2c_unregister_device(at24->client[i].client);