From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
Peter Rosin <peda@axentia.se>,
Sven Van Asbroeck <svendev@arcx.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH 2/4] eeprom: at24: use devm_nvmem_register()
Date: Tue, 10 Apr 2018 15:12:04 +0200 [thread overview]
Message-ID: <20180410131206.25760-3-brgl@bgdev.pl> (raw)
In-Reply-To: <20180410131206.25760-1-brgl@bgdev.pl>
We now have a managed variant of nvmem_register(). Use it
in at24_probe().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.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
next prev parent reply other threads:[~2018-04-10 13:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-10 13:12 [PATCH 0/4] eeprom: at24: last bits of the big refactoring Bartosz Golaszewski
2018-04-10 13:12 ` [PATCH 1/4] eeprom: at24: don't assign the i2c ID table to at24_driver Bartosz Golaszewski
2018-04-11 9:56 ` Peter Rosin
2018-04-11 10:09 ` Bartosz Golaszewski
2018-04-11 10:12 ` Peter Rosin
2018-04-11 11:14 ` Bartosz Golaszewski
2018-04-10 13:12 ` Bartosz Golaszewski [this message]
2018-04-10 13:12 ` [PATCH 3/4] eeprom: at24: provide and use a helper for releasing dummy i2c clients Bartosz Golaszewski
2018-04-10 13:12 ` [PATCH 4/4] eeprom: at24: provide a separate routine for creating " Bartosz Golaszewski
2018-04-11 11:44 ` Peter Rosin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180410131206.25760-3-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=andy.shevchenko@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peda@axentia.se \
--cc=svendev@arcx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).