nvmem: core: switch to use device_add_groups()
PATCH 1/1 nvmem: core: switch to use device_add_groups()
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.
--- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/core.c +1 -1
@@ -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;
Signature · 1 line
2.44.0
Srinivas Kandagatla
AppliedQuoted 8 lines · Greg Kroah-Hartman
devm_device_add_groups()is being removed from the kernel, so move the nvmem driver to usedevice_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,
Signature · 1 line
Srinivas Kandagatla <[email protected]>