LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvmem: core: switch to use device_add_groups()
@ 2024-03-27  8:11 Greg Kroah-Hartman
  2024-04-11 10:03 ` Srinivas Kandagatla
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2024-03-27  8:11 UTC (permalink / raw
  To: srinivas.kandagatla; +Cc: linux-kernel, Greg Kroah-Hartman

devm_device_add_groups() is being removed from the kernel, so move the
nvmem driver to use device_add_groups() instead.  The logic is
identical, when the device is removed the driver core will properly
clean up and remove the groups, and the memory used by the attribute
groups will be freed because it was created with dev_* calls, so this is
functionally identical overall.

Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/nvmem/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 2c6b99402df8..e1ec3b7200d7 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -478,7 +478,7 @@ static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)
 
 	nvmem_cells_group.bin_attrs = cells_attrs;
 
-	ret = devm_device_add_groups(&nvmem->dev, nvmem_cells_groups);
+	ret = device_add_groups(&nvmem->dev, nvmem_cells_groups);
 	if (ret)
 		goto unlock_mutex;
 
-- 
2.44.0


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

* Re: [PATCH] nvmem: core: switch to use device_add_groups()
  2024-03-27  8:11 [PATCH] nvmem: core: switch to use device_add_groups() Greg Kroah-Hartman
@ 2024-04-11 10:03 ` Srinivas Kandagatla
  0 siblings, 0 replies; 2+ messages in thread
From: Srinivas Kandagatla @ 2024-04-11 10:03 UTC (permalink / raw
  To: Greg Kroah-Hartman; +Cc: linux-kernel


On Wed, 27 Mar 2024 09:11:46 +0100, Greg Kroah-Hartman wrote:
> devm_device_add_groups() is being removed from the kernel, so move the
> nvmem driver to use device_add_groups() instead.  The logic is
> identical, when the device is removed the driver core will properly
> clean up and remove the groups, and the memory used by the attribute
> groups will be freed because it was created with dev_* calls, so this is
> functionally identical overall.
> 
> [...]

Applied, thanks!

[1/1] nvmem: core: switch to use device_add_groups()
      commit: ea8f9ec2bbb75adac49dbaaf267f8727ee26b91b

Best regards,
-- 
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


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

end of thread, other threads:[~2024-04-11 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27  8:11 [PATCH] nvmem: core: switch to use device_add_groups() Greg Kroah-Hartman
2024-04-11 10:03 ` Srinivas Kandagatla

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 read-only IMAP folder(s) and NNTP newsgroup(s).