All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] eeprom: use devres for nvmem providers
@ 2018-09-10  7:44 Bartosz Golaszewski
  2018-09-10  7:44 ` [PATCH 1/2] eeprom: eeprom_93xx46: use resource management Bartosz Golaszewski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2018-09-10  7:44 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Rob Herring,
	Gustavo A . R . Silva, Devang Panchal, Geert Uytterhoeven,
	Srinivas Kandagatla
  Cc: linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

While working on the nvmem framework recently I noticed that there are
many providers that don't use the devm variant of nvmem_register().
This series contains relevant updates for eeprom drivers.

Bartosz Golaszewski (2):
  eeprom: eeprom_93xx46: use resource management
  eeprom: at25: use devm_nvmem_register()

 drivers/misc/eeprom/at25.c          | 3 +--
 drivers/misc/eeprom/eeprom_93xx46.c | 7 ++-----
 2 files changed, 3 insertions(+), 7 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] eeprom: eeprom_93xx46: use resource management
  2018-09-10  7:44 [PATCH 0/2] eeprom: use devres for nvmem providers Bartosz Golaszewski
@ 2018-09-10  7:44 ` Bartosz Golaszewski
  2018-09-10  7:44 ` [PATCH 2/2] eeprom: at25: use devm_nvmem_register() Bartosz Golaszewski
  2018-09-10  7:50 ` [PATCH 0/2] eeprom: use devres for nvmem providers Srinivas Kandagatla
  2 siblings, 0 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2018-09-10  7:44 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Rob Herring,
	Gustavo A . R . Silva, Devang Panchal, Geert Uytterhoeven,
	Srinivas Kandagatla
  Cc: linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Use resource managed variants of nvmem_register() and kzalloc().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/misc/eeprom/eeprom_93xx46.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
index 38766968bfa2..a06853543204 100644
--- a/drivers/misc/eeprom/eeprom_93xx46.c
+++ b/drivers/misc/eeprom/eeprom_93xx46.c
@@ -439,7 +439,7 @@ static int eeprom_93xx46_probe(struct spi_device *spi)
 		return -ENODEV;
 	}
 
-	edev = kzalloc(sizeof(*edev), GFP_KERNEL);
+	edev = devm_kzalloc(&spi->dev, sizeof(*edev), GFP_KERNEL);
 	if (!edev)
 		return -ENOMEM;
 
@@ -473,7 +473,7 @@ static int eeprom_93xx46_probe(struct spi_device *spi)
 	edev->nvmem_config.word_size = 1;
 	edev->nvmem_config.size = edev->size;
 
-	edev->nvmem = nvmem_register(&edev->nvmem_config);
+	edev->nvmem = devm_nvmem_register(&spi->dev, &edev->nvmem_config);
 	if (IS_ERR(edev->nvmem)) {
 		err = PTR_ERR(edev->nvmem);
 		goto fail;
@@ -499,12 +499,9 @@ static int eeprom_93xx46_remove(struct spi_device *spi)
 {
 	struct eeprom_93xx46_dev *edev = spi_get_drvdata(spi);
 
-	nvmem_unregister(edev->nvmem);
-
 	if (!(edev->pdata->flags & EE_READONLY))
 		device_remove_file(&spi->dev, &dev_attr_erase);
 
-	kfree(edev);
 	return 0;
 }
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] eeprom: at25: use devm_nvmem_register()
  2018-09-10  7:44 [PATCH 0/2] eeprom: use devres for nvmem providers Bartosz Golaszewski
  2018-09-10  7:44 ` [PATCH 1/2] eeprom: eeprom_93xx46: use resource management Bartosz Golaszewski
@ 2018-09-10  7:44 ` Bartosz Golaszewski
  2018-09-10  7:50 ` [PATCH 0/2] eeprom: use devres for nvmem providers Srinivas Kandagatla
  2 siblings, 0 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2018-09-10  7:44 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Rob Herring,
	Gustavo A . R . Silva, Devang Panchal, Geert Uytterhoeven,
	Srinivas Kandagatla
  Cc: linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Use the resource managed variant of nvmem_register().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/misc/eeprom/at25.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index 840afb398f9e..d874df72853f 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -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);
 
@@ -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;
 }
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] eeprom: use devres for nvmem providers
  2018-09-10  7:44 [PATCH 0/2] eeprom: use devres for nvmem providers Bartosz Golaszewski
  2018-09-10  7:44 ` [PATCH 1/2] eeprom: eeprom_93xx46: use resource management Bartosz Golaszewski
  2018-09-10  7:44 ` [PATCH 2/2] eeprom: at25: use devm_nvmem_register() Bartosz Golaszewski
@ 2018-09-10  7:50 ` Srinivas Kandagatla
  2018-09-10  7:54   ` Bartosz Golaszewski
  2 siblings, 1 reply; 7+ messages in thread
From: Srinivas Kandagatla @ 2018-09-10  7:50 UTC (permalink / raw)
  To: Bartosz Golaszewski, Arnd Bergmann, Greg Kroah-Hartman,
	Rob Herring, Gustavo A . R . Silva, Devang Panchal,
	Geert Uytterhoeven
  Cc: linux-kernel, Bartosz Golaszewski



On 10/09/18 08:44, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> While working on the nvmem framework recently I noticed that there are
> many providers that don't use the devm variant of nvmem_register().
> This series contains relevant updates for eeprom drivers.
> 
> Bartosz Golaszewski (2):
>    eeprom: eeprom_93xx46: use resource management
>    eeprom: at25: use devm_nvmem_register()
> 
>   drivers/misc/eeprom/at25.c          | 3 +--
>   drivers/misc/eeprom/eeprom_93xx46.c | 7 ++-----

Can you please consider consolidating the devm related changes in a 
single series, to easy the review!

>   2 files changed, 3 insertions(+), 7 deletions(-)
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] eeprom: use devres for nvmem providers
  2018-09-10  7:50 ` [PATCH 0/2] eeprom: use devres for nvmem providers Srinivas Kandagatla
@ 2018-09-10  7:54   ` Bartosz Golaszewski
  2018-09-10  7:59     ` Srinivas Kandagatla
  0 siblings, 1 reply; 7+ messages in thread
From: Bartosz Golaszewski @ 2018-09-10  7:54 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Rob Herring,
	Gustavo A . R . Silva, Devang Panchal, Geert Uytterhoeven,
	Linux Kernel Mailing List, Bartosz Golaszewski

2018-09-10 9:50 GMT+02:00 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
>
>
> On 10/09/18 08:44, Bartosz Golaszewski wrote:
>>
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> While working on the nvmem framework recently I noticed that there are
>> many providers that don't use the devm variant of nvmem_register().
>> This series contains relevant updates for eeprom drivers.
>>
>> Bartosz Golaszewski (2):
>>    eeprom: eeprom_93xx46: use resource management
>>    eeprom: at25: use devm_nvmem_register()
>>
>>   drivers/misc/eeprom/at25.c          | 3 +--
>>   drivers/misc/eeprom/eeprom_93xx46.c | 7 ++-----
>
>
> Can you please consider consolidating the devm related changes in a single
> series, to easy the review!
>
>
>>   2 files changed, 3 insertions(+), 7 deletions(-)
>>
>

Are you referring to the devm part of the bigger nvmem series? If so:
no, because the nvmem patches are required by the later patches in
that series. These two patches are independent and should probably go
through Greg's tree directly.

Best regards,
Bartosz Golaszewski

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] eeprom: use devres for nvmem providers
  2018-09-10  7:54   ` Bartosz Golaszewski
@ 2018-09-10  7:59     ` Srinivas Kandagatla
  2018-09-10  8:08       ` Bartosz Golaszewski
  0 siblings, 1 reply; 7+ messages in thread
From: Srinivas Kandagatla @ 2018-09-10  7:59 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Rob Herring,
	Gustavo A . R . Silva, Devang Panchal, Geert Uytterhoeven,
	Linux Kernel Mailing List, Bartosz Golaszewski



On 10/09/18 08:54, Bartosz Golaszewski wrote:
> 2018-09-10 9:50 GMT+02:00 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
>>
>>
>> On 10/09/18 08:44, Bartosz Golaszewski wrote:
>>>
>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>
>>> While working on the nvmem framework recently I noticed that there are
>>> many providers that don't use the devm variant of nvmem_register().
>>> This series contains relevant updates for eeprom drivers.
>>>
>>> Bartosz Golaszewski (2):
>>>     eeprom: eeprom_93xx46: use resource management
>>>     eeprom: at25: use devm_nvmem_register()
>>>
>>>    drivers/misc/eeprom/at25.c          | 3 +--
>>>    drivers/misc/eeprom/eeprom_93xx46.c | 7 ++-----
>>
>>
>> Can you please consider consolidating the devm related changes in a single
>> series, to easy the review!
>>
>>
>>>    2 files changed, 3 insertions(+), 7 deletions(-)
>>>
>>
> 
> Are you referring to the devm part of the bigger nvmem series? If so:
> no, because the nvmem patches are required by the later patches in
Yes, am referring to that series.
I dont see any reason why lpc and sunxi changes should not be in this 
series? Or there is no implicit reasoning or change log that suggests 
that these have to be part of that series!


--srini

> that series. These two patches are independent and should probably go
> through Greg's tree directly.
> 
> Best regards,
> Bartosz Golaszewski
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] eeprom: use devres for nvmem providers
  2018-09-10  7:59     ` Srinivas Kandagatla
@ 2018-09-10  8:08       ` Bartosz Golaszewski
  0 siblings, 0 replies; 7+ messages in thread
From: Bartosz Golaszewski @ 2018-09-10  8:08 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Rob Herring,
	Gustavo A . R . Silva, Devang Panchal, Geert Uytterhoeven,
	Linux Kernel Mailing List, Bartosz Golaszewski

2018-09-10 9:59 GMT+02:00 Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:
>
>
> On 10/09/18 08:54, Bartosz Golaszewski wrote:
>>
>> 2018-09-10 9:50 GMT+02:00 Srinivas Kandagatla
>> <srinivas.kandagatla@linaro.org>:
>>>
>>>
>>>
>>> On 10/09/18 08:44, Bartosz Golaszewski wrote:
>>>>
>>>>
>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>
>>>> While working on the nvmem framework recently I noticed that there are
>>>> many providers that don't use the devm variant of nvmem_register().
>>>> This series contains relevant updates for eeprom drivers.
>>>>
>>>> Bartosz Golaszewski (2):
>>>>     eeprom: eeprom_93xx46: use resource management
>>>>     eeprom: at25: use devm_nvmem_register()
>>>>
>>>>    drivers/misc/eeprom/at25.c          | 3 +--
>>>>    drivers/misc/eeprom/eeprom_93xx46.c | 7 ++-----
>>>
>>>
>>>
>>> Can you please consider consolidating the devm related changes in a
>>> single
>>> series, to easy the review!
>>>
>>>
>>>>    2 files changed, 3 insertions(+), 7 deletions(-)
>>>>
>>>
>>
>> Are you referring to the devm part of the bigger nvmem series? If so:
>> no, because the nvmem patches are required by the later patches in
>
> Yes, am referring to that series.
> I dont see any reason why lpc and sunxi changes should not be in this
> series? Or there is no implicit reasoning or change log that suggests that
> these have to be part of that series!
>
>

Patch ("nvmem: change the signature of nvmem_unregister()") depends on
those three patches in the other series. We need to change them first
because they were still checking the return value of
nvmem_unregister(). And this patch results from the earlier kref
patch. I think that although this nvmem series is pretty big, it
contains mostly related changes and it will be hard to submit them
separately.

Bart


> --srini
>
>
>> that series. These two patches are independent and should probably go
>> through Greg's tree directly.
>>
>> Best regards,
>> Bartosz Golaszewski
>>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-10  8:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10  7:44 [PATCH 0/2] eeprom: use devres for nvmem providers Bartosz Golaszewski
2018-09-10  7:44 ` [PATCH 1/2] eeprom: eeprom_93xx46: use resource management Bartosz Golaszewski
2018-09-10  7:44 ` [PATCH 2/2] eeprom: at25: use devm_nvmem_register() Bartosz Golaszewski
2018-09-10  7:50 ` [PATCH 0/2] eeprom: use devres for nvmem providers Srinivas Kandagatla
2018-09-10  7:54   ` Bartosz Golaszewski
2018-09-10  7:59     ` Srinivas Kandagatla
2018-09-10  8:08       ` Bartosz Golaszewski

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.