From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH 02/21] eeprom: at24: remove nvmem_config from at24_data
Date: Mon, 19 Mar 2018 10:17:02 +0100 [thread overview]
Message-ID: <20180319091721.18193-3-brgl@bgdev.pl> (raw)
In-Reply-To: <20180319091721.18193-1-brgl@bgdev.pl>
This structure only needs to exist during the call to nvmem_register().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
drivers/misc/eeprom/at24.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 73af6c5a2d73..2600657c7034 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -75,7 +75,6 @@ struct at24_data {
unsigned int num_addresses;
unsigned int offset_adj;
- struct nvmem_config nvmem_config;
struct nvmem_device *nvmem;
struct gpio_desc *wp_gpio;
@@ -523,6 +522,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
int err;
unsigned int i, num_addresses;
struct regmap_config regmap_config = { };
+ struct nvmem_config nvmem_config = { };
u8 test_byte;
if (client->dev.platform_data) {
@@ -650,21 +650,21 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
goto err_clients;
}
- at24->nvmem_config.name = dev_name(&client->dev);
- at24->nvmem_config.dev = &client->dev;
- at24->nvmem_config.read_only = !writable;
- at24->nvmem_config.root_only = true;
- at24->nvmem_config.owner = THIS_MODULE;
- at24->nvmem_config.compat = true;
- at24->nvmem_config.base_dev = &client->dev;
- at24->nvmem_config.reg_read = at24_read;
- at24->nvmem_config.reg_write = at24_write;
- at24->nvmem_config.priv = at24;
- at24->nvmem_config.stride = 1;
- at24->nvmem_config.word_size = 1;
- at24->nvmem_config.size = chip.byte_len;
-
- at24->nvmem = nvmem_register(&at24->nvmem_config);
+ nvmem_config.name = dev_name(&client->dev);
+ nvmem_config.dev = &client->dev;
+ nvmem_config.read_only = !writable;
+ nvmem_config.root_only = true;
+ nvmem_config.owner = THIS_MODULE;
+ nvmem_config.compat = true;
+ nvmem_config.base_dev = &client->dev;
+ nvmem_config.reg_read = at24_read;
+ nvmem_config.reg_write = at24_write;
+ nvmem_config.priv = at24;
+ nvmem_config.stride = 1;
+ nvmem_config.word_size = 1;
+ nvmem_config.size = chip.byte_len;
+
+ at24->nvmem = nvmem_register(&nvmem_config);
if (IS_ERR(at24->nvmem)) {
err = PTR_ERR(at24->nvmem);
--
2.16.1
WARNING: multiple messages have this Message-ID (diff)
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: [PATCH 02/21] eeprom: at24: remove nvmem_config from at24_data
Date: Mon, 19 Mar 2018 10:17:02 +0100 [thread overview]
Message-ID: <20180319091721.18193-3-brgl@bgdev.pl> (raw)
In-Reply-To: <20180319091721.18193-1-brgl@bgdev.pl>
This structure only needs to exist during the call to nvmem_register().
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/misc/eeprom/at24.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 73af6c5a2d73..2600657c7034 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -75,7 +75,6 @@ struct at24_data {
unsigned int num_addresses;
unsigned int offset_adj;
- struct nvmem_config nvmem_config;
struct nvmem_device *nvmem;
struct gpio_desc *wp_gpio;
@@ -523,6 +522,7 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
int err;
unsigned int i, num_addresses;
struct regmap_config regmap_config = { };
+ struct nvmem_config nvmem_config = { };
u8 test_byte;
if (client->dev.platform_data) {
@@ -650,21 +650,21 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
goto err_clients;
}
- at24->nvmem_config.name = dev_name(&client->dev);
- at24->nvmem_config.dev = &client->dev;
- at24->nvmem_config.read_only = !writable;
- at24->nvmem_config.root_only = true;
- at24->nvmem_config.owner = THIS_MODULE;
- at24->nvmem_config.compat = true;
- at24->nvmem_config.base_dev = &client->dev;
- at24->nvmem_config.reg_read = at24_read;
- at24->nvmem_config.reg_write = at24_write;
- at24->nvmem_config.priv = at24;
- at24->nvmem_config.stride = 1;
- at24->nvmem_config.word_size = 1;
- at24->nvmem_config.size = chip.byte_len;
-
- at24->nvmem = nvmem_register(&at24->nvmem_config);
+ nvmem_config.name = dev_name(&client->dev);
+ nvmem_config.dev = &client->dev;
+ nvmem_config.read_only = !writable;
+ nvmem_config.root_only = true;
+ nvmem_config.owner = THIS_MODULE;
+ nvmem_config.compat = true;
+ nvmem_config.base_dev = &client->dev;
+ nvmem_config.reg_read = at24_read;
+ nvmem_config.reg_write = at24_write;
+ nvmem_config.priv = at24;
+ nvmem_config.stride = 1;
+ nvmem_config.word_size = 1;
+ nvmem_config.size = chip.byte_len;
+
+ at24->nvmem = nvmem_register(&nvmem_config);
if (IS_ERR(at24->nvmem)) {
err = PTR_ERR(at24->nvmem);
--
2.16.1
next prev parent reply other threads:[~2018-03-19 9:17 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-19 9:17 [PATCH 00/21] eeprom: at24: driver refactoring Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 01/21] eeprom: at24: disable regmap locking Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski [this message]
2018-03-19 9:17 ` [PATCH 02/21] eeprom: at24: remove nvmem_config from at24_data Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 03/21] eeprom: at24: arrange local variables Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-23 15:21 ` Greg Kroah-Hartman
2018-03-23 16:06 ` Bartosz Golaszewski
2018-03-23 16:37 ` Greg Kroah-Hartman
2018-03-19 9:17 ` [PATCH 04/21] eeprom: at24: use SPDX identifier instead of GPL boiler-plate Bartosz Golaszewski
2018-03-19 11:03 ` Peter Rosin
2018-03-19 12:12 ` Bartosz Golaszewski
2018-03-19 12:51 ` Peter Rosin
2018-03-19 12:56 ` Bartosz Golaszewski
2018-03-19 15:38 ` Greg Kroah-Hartman
2018-03-19 15:43 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 05/21] eeprom: at24: remove code separators Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 06/21] eeprom: at24: drop redundant variable in at24_read() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 07/21] eeprom: at24: drop redundant variable in at24_write() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 08/21] eeprom: at24: make struct initialization uniform in at24_probe() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 09/21] eeprom: at24: don't check if byte_len is a power of 2 Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 10/21] eeprom: at24: rename at24_get_pdata() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 11/21] eeprom: at24: rename chip to pdata in at24_probe() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 12/21] eeprom: at24: use a helper variable for dev Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 13/21] eeprom: at24: readability tweak in at24_probe() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 14/21] eeprom: at24: provide and use at24_base_client_dev() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 15/21] eeprom: at24: switch to using probe_new() from the i2c framework Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 16/21] eeprom: at24: move platform data processing into a separate routine Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 17/21] eeprom: at24: remove at24_platform_data from at24_data Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 18/21] eeprom: at24: refactor at24_probe() Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 19/21] eeprom: at24: tweak newlines Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 20/21] eeprom: at24: fix a line break Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 9:17 ` [PATCH 21/21] eeprom: at24: simplify the i2c functionality checking Bartosz Golaszewski
2018-03-19 9:17 ` Bartosz Golaszewski
2018-03-19 14:43 ` [PATCH 00/21] eeprom: at24: driver refactoring Andy Shevchenko
2018-03-19 15:21 ` Bartosz Golaszewski
2018-03-21 14:52 ` Andy Shevchenko
2018-03-23 15:26 ` Greg Kroah-Hartman
2018-03-23 16:13 ` Bartosz Golaszewski
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=20180319091721.18193-3-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.