[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180410131206.25760-3-brgl@bgdev.pl>
Date: Tue, 10 Apr 2018 15:12:04 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andy.shevchenko@...il.com>,
Peter Rosin <peda@...ntia.se>,
Sven Van Asbroeck <svendev@...x.com>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <brgl@...ev.pl>
Subject: [PATCH 2/4] 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@...ev.pl>
---
drivers/misc/eeprom/at24.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 2310f26ac4f3..5e56a99435c6 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);
--
2.17.0
Powered by blists - more mailing lists