Skip to content

Commit 8d8fc14

Browse files
committed
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. Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20240430084921.33387-7-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 154c1ec commit 8d8fc14

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/nvmem/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ static int nvmem_populate_sysfs_cells(struct nvmem_device *nvmem)
478478

479479
nvmem_cells_group.bin_attrs = cells_attrs;
480480

481-
ret = devm_device_add_groups(&nvmem->dev, nvmem_cells_groups);
481+
ret = device_add_groups(&nvmem->dev, nvmem_cells_groups);
482482
if (ret)
483483
goto unlock_mutex;
484484

0 commit comments

Comments
 (0)